Skip to content

Commit e093a2e

Browse files
authored
Doc Tools MCP Server (#157)
* Init MCP * Add comprehensive documentation for extensions and macros - Add development guides for extensions and macros - Add user guides with examples and usage patterns - Add reference documentation for APIs - Add README files for both components * Add MCP server implementation and tests - Implement MCP server with tool handlers - Add comprehensive test suite for MCP functionality - Add MCP tools directory with server utilities * Update CLI tools for MCP integration - Enhance doc-tools-mcp.js with improved tool handlers - Update doc-tools.js with new command routing - Refactor setup-mcp.js for better initialization * Add GitHub Actions workflow for MCP testing * Add CLI documentation generation tooling - Add script to generate CLI reference documentation - Add generated CLI reference in AsciiDoc format * Add contributing guidelines * Update package.json with new dependencies * Update README with improved documentation structure - Simplify main README - Reference new documentation files for details * Remove deprecated MCP_SERVER.md Documentation moved to mcp/README.adoc * Bump version * Allow MCP server to work from any repo with doc-tools installed Previously, the MCP server only worked when run from the docs-extensions-and-macros source repository by checking for bin/doc-tools.js. This prevented using the MCP server from documentation repositories that have doc-tools installed as a dependency. Now the validation: 1. First checks if we're in the source repo (bin/doc-tools.js exists) 2. Falls back to checking if doc-tools is available via npx This allows the MCP server to work from any repository that has doc-tools installed or available, while still working from the source repository for development. * Apply suggestions * Fix tests * Apply suggestions * Apply suggestions * Apply suggestions * Improve schema * Add background job support to rpk and metrics * Fix defaults issue * Allow for local dev * Retry logic * Add unified support for tokens * Fix docker commands * Remove cloud restriction * Fix name * Rearchitect MCP server for writer extensibility * Update crd-docs to support local mode * Improve reviews * Fix tests
1 parent 0279df9 commit e093a2e

File tree

93 files changed

+23418
-1583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+23418
-1583
lines changed

.github/workflows/test-mcp.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Test MCP Server
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'bin/**'
8+
- '__tests__/mcp/**'
9+
- 'package.json'
10+
pull_request:
11+
paths:
12+
- 'bin/**'
13+
- '__tests__/mcp/**'
14+
- 'package.json'
15+
16+
permissions:
17+
checks: write
18+
pull-requests: write
19+
contents: read
20+
21+
jobs:
22+
test-mcp:
23+
name: Test MCP Server Integration
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: 'npm'
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Run MCP integration tests
40+
run: npm test -- __tests__/mcp/
41+
env:
42+
# Set test timeout for network operations
43+
JEST_TIMEOUT: 30000
44+
45+
- name: Report test results
46+
if: always()
47+
uses: dorny/test-reporter@v1
48+
with:
49+
name: MCP Test Results
50+
path: 'test-results/**/*.xml'
51+
reporter: jest-junit
52+
fail-on-error: true
53+
54+
test-cli-contract:
55+
name: Verify CLI Contract
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
- name: Setup Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: '20'
66+
cache: 'npm'
67+
68+
- name: Install dependencies
69+
run: npm ci
70+
71+
- name: Run CLI contract tests
72+
run: npm test -- __tests__/mcp/cli-contract.test.js
73+
74+
- name: Verify all generate commands exist
75+
run: |
76+
echo "Verifying generate commands..."
77+
npx doc-tools generate --help | grep -E "(property-docs|metrics-docs|rpk-docs|rpcn-connector-docs|helm-spec|cloud-regions|crd-spec|bundle-openapi)"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ __pycache__/
88
gen/
99
tree-sitter/
1010
test/
11+
test-results/
1112
modules/
1213
cloud-controlplane/
1314
node_modules
15+
.env
16+
mcp-usage-stats.json

0 commit comments

Comments
 (0)