Skip to content

Commit 0e71f8d

Browse files
committed
Add comprehensive MCP server implementation with testing
- Implement complete MCP server in eng/mcp-server/ with TypeScript - Add 54 comprehensive tests achieving 96.15% statement coverage - Add MCP testing scripts to root package.json (test:mcp, test:mcp:coverage, test:mcp:watch) - Update .gitignore with comprehensive patterns for Node.js projects - Update AGENTS.md with MCP testing requirements in pre-commit checklist - Fix line endings to LF (Unix-style) for all markdown files - All collection validations pass (30/30)
1 parent 8baf6d7 commit 0e71f8d

Some content is hidden

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

45 files changed

+7850
-7
lines changed

.gitignore

Lines changed: 110 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,113 @@
1-
node_modules
2-
*.orig
3-
Copilot-Processing.md
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build outputs
8+
dist/
9+
build/
10+
*.tsbuildinfo
11+
12+
# Test coverage
13+
coverage/
14+
.nyc_output/
15+
16+
# Environment variables
17+
.env
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
# Logs
24+
logs/
25+
*.log
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
lerna-debug.log*
30+
31+
# Runtime data
32+
pids/
33+
*.pid
34+
*.seed
35+
*.pid.lock
36+
37+
# Coverage directory used by tools like istanbul
38+
lib-cov/
39+
40+
# nyc test coverage
41+
.nyc_output/
42+
43+
# Dependency directories
44+
jspm_packages/
45+
46+
# Optional npm cache directory
47+
.npm
48+
49+
# Optional REPL history
50+
.node_repl_history
51+
52+
# Output of 'npm pack'
53+
*.tgz
54+
55+
# Yarn Integrity file
56+
.yarn-integrity
57+
58+
# dotenv environment variables file
59+
.env.test
460

5-
# macOS system files
61+
# parcel-bundler cache (https://parceljs.org/)
62+
.cache
63+
.parcel-cache
64+
65+
# next.js build output
66+
.next
67+
68+
# nuxt.js build output
69+
.nuxt
70+
71+
# vuepress build output
72+
.vuepress/dist
73+
74+
# Serverless directories
75+
.serverless
76+
77+
# FuseBox cache
78+
.fusebox/
79+
80+
# DynamoDB Local files
81+
.dynamodb/
82+
83+
# TernJS port file
84+
.tern-port
85+
86+
# Stores VSCode versions used for testing VSCode extensions
87+
.vscode-test
88+
89+
# OS generated files
690
.DS_Store
91+
.DS_Store?
92+
._*
93+
.Spotlight-V100
94+
.Trashes
95+
ehthumbs.db
96+
Thumbs.db
97+
98+
# IDE files
99+
.vscode/settings.json
100+
.idea/
101+
*.swp
102+
*.swo
103+
*~
104+
105+
# Temporary files
7106
*.tmp
107+
*.temp
108+
*.orig
109+
Copilot-Processing.md
110+
111+
# Lock files (optional - some teams prefer to commit these)
112+
# package-lock.json
113+
# yarn.lock

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ npm run collection:validate
8080
# Build and verify README generation
8181
npm run build
8282

83+
# Test MCP server functionality
84+
npm run test:mcp
85+
86+
# Test MCP server with coverage report
87+
npm run test:mcp:coverage
88+
8389
# Fix line endings (required before committing)
8490
bash scripts/fix-line-endings.sh
8591
```
@@ -121,6 +127,7 @@ When creating a pull request:
121127
Before submitting your PR, ensure you have:
122128
- [ ] Run `npm install` (or `npm ci`) to install dependencies
123129
- [ ] Run `npm run build` to generate the updated README.md
130+
- [ ] Run `npm run test:mcp` to verify MCP server tests pass
124131
- [ ] Run `bash scripts/fix-line-endings.sh` to normalize line endings
125132
- [ ] Verified that all new files have proper front matter
126133
- [ ] Tested that your contribution works with GitHub Copilot

eng/mcp-server/jest.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/** @type {import('jest').Config} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
roots: ['<rootDir>/src', '<rootDir>/tests'],
6+
testMatch: ['**/__tests__/**/*.test.ts', '**/?(*.)+(spec|test).ts'],
7+
transform: {
8+
'^.+\\.ts$': ['ts-jest', {
9+
tsconfig: 'tsconfig.json',
10+
}],
11+
},
12+
moduleNameMapper: {
13+
'^\\.\\./src/(.*)$': '<rootDir>/src/$1',
14+
},
15+
collectCoverageFrom: [
16+
'src/**/*.ts',
17+
'!src/**/*.d.ts',
18+
'!src/index.ts', // Main entry point, tested via integration tests
19+
],
20+
coverageDirectory: 'coverage',
21+
coverageReporters: ['text', 'lcov', 'html'],
22+
coverageThreshold: {
23+
global: {
24+
branches: 80,
25+
functions: 80,
26+
lines: 80,
27+
statements: 80,
28+
},
29+
},
30+
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
31+
testTimeout: 10000,
32+
};

eng/mcp-server/mcp-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"mcp": {"command": "node", "args": ["dist/index.js"]}}

0 commit comments

Comments
 (0)