Skip to content

Commit 3b1c7d6

Browse files
committed
Added CONTRIBUTING.md file
1 parent 7d3f999 commit 3b1c7d6

File tree

2 files changed

+111
-52
lines changed

2 files changed

+111
-52
lines changed

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Contributing to MCP Server Tester
2+
3+
Thanks for your interest in contributing! This guide explains how to get involved.
4+
5+
## Getting Started
6+
7+
1. Fork the repository and clone it locally
8+
2. Install dependencies with `npm install`
9+
3. Run `npm run dev` to start the CLI in development mode
10+
4. Test your changes with the example test files in the `examples/` directory
11+
12+
## Development Process & Pull Requests
13+
14+
1. Create a new branch for your changes
15+
2. Make your changes following existing code style and conventions
16+
- Run `npm run lint` and `npm run format` to check code style
17+
- Run `npm run typecheck` to verify TypeScript types
18+
3. Test changes thoroughly:
19+
- Run `npm test` to run all tests
20+
- Test with real MCP servers when possible
21+
4. Update documentation as needed (README.md, inline comments)
22+
5. Use clear commit messages explaining your changes
23+
6. Verify all changes work as expected
24+
7. Submit a pull request with a clear description of changes
25+
8. PRs will be reviewed quickly by maintainers
26+
27+
## Development Commands
28+
29+
- `npm run dev` - Run CLI in development mode
30+
- `npm test` - Run all tests
31+
- `npm run lint` - Check code style
32+
- `npm run format` - Format code
33+
- `npm run typecheck` - Check TypeScript types
34+
- `npm run build` - Build for production
35+
36+
## Testing Guidelines
37+
38+
- Add unit tests for new functionality
39+
- Include integration tests for CLI commands
40+
- Test with various MCP server configurations
41+
- Verify eval tests work with different LLM responses
42+
- Check edge cases and error handling
43+
44+
## Code Style
45+
46+
- Follow existing TypeScript/JavaScript conventions
47+
- Use meaningful variable and function names
48+
- Add JSDoc comments for public APIs
49+
- Keep functions focused and testable
50+
- Use the existing error handling patterns
51+
52+
## Questions?
53+
54+
Feel free to open an issue for questions or create a discussion for general topics about MCP server testing.
55+
56+
## License
57+
58+
By contributing, you agree that your contributions will be licensed under the MIT license.

README.md

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -96,71 +96,71 @@ See the [Compliance Command (WIP)](#compliance-command-wip) section below for de
9696

9797
2. **Create tool and eval test files manually**:
9898

99-
**`tool-tests.yaml`**:
100-
101-
```yaml
102-
tools:
103-
expected_tool_list: ['write_file']
104-
tests:
105-
- name: 'Write file successfully'
106-
tool: 'write_file'
107-
params: { path: '/tmp/test.txt', content: 'Hello world' }
108-
expect: { success: true }
109-
```
110-
111-
**`eval-tests.yaml`**:
99+
**`tool-tests.yaml`**:
100+
101+
```yaml
102+
tools:
103+
expected_tool_list: ['write_file']
104+
tests:
105+
- name: 'Write file successfully'
106+
tool: 'write_file'
107+
params: { path: '/tmp/test.txt', content: 'Hello world' }
108+
expect: { success: true }
109+
```
112110
113-
```yaml
114-
evals:
115-
models: ['claude-3-5-haiku-latest']
116-
tests:
117-
- name: 'LLM can write files'
118-
prompt: 'Create a file at /tmp/greeting.txt with the content "Hello from Claude"'
119-
expected_tool_calls:
120-
required: ['write_file']
121-
response_scorers:
122-
- type: 'llm-judge'
123-
criteria: 'Did the assistant successfully create the file?'
124-
threshold: 0.8
125-
```
111+
**`eval-tests.yaml`**:
112+
113+
```yaml
114+
evals:
115+
models: ['claude-3-5-haiku-latest']
116+
tests:
117+
- name: 'LLM can write files'
118+
prompt: 'Create a file at /tmp/greeting.txt with the content "Hello from Claude"'
119+
expected_tool_calls:
120+
required: ['write_file']
121+
response_scorers:
122+
- type: 'llm-judge'
123+
criteria: 'Did the assistant successfully create the file?'
124+
threshold: 0.8
125+
```
126126

127-
See the [Tools Testing](#tools-testing) and [Evals Testing](#evals-testing) sections for comprehensive syntax examples.
127+
See the [Tools Testing](#tools-testing) and [Evals Testing](#evals-testing) sections for comprehensive syntax examples.
128128

129-
2. **Create tool and eval tests automatically using an agent**:
129+
3. **Create tool and eval tests automatically using an agent**:
130130

131-
Try out this prompt, replacing the server config information with your own:
131+
Try out this prompt, replacing the server config information with your own:
132132

133-
```
134-
Please create tool tests and eval tests for me to use with the mcp server tester tool.
135-
To see how to use it, run the tool's documentation and schema commands:
133+
```
134+
Please create tool tests and eval tests for me to use with the mcp server tester tool.
135+
To see how to use it, run the tool's documentation and schema commands:
136136

137-
`npx -y mcp-server-tester --help`
137+
`npx -y mcp-server-tester --help`
138138

139-
My server config file is at ./filesystem-server-config.json. To know what tools you need to create tests for, run this command:
139+
My server config file is at ./filesystem-server-config.json. To know what tools you need to create tests for, run this command:
140140

141-
`npx -y @modelcontextprotocol/inspector --cli --config filesystem-server-config.json --server filesystem-server --method tools/list`
141+
`npx -y @modelcontextprotocol/inspector --cli --config filesystem-server-config.json --server filesystem-server --method tools/list`
142142

143-
Please follow these steps:
143+
Please follow these steps:
144144

145-
1. Create tool tests
146-
- Create a file called `tool-tests.yaml` that contains a single test for each tool. Follow these guidelines:
147-
- Do NOT force an individual test to pass; if the expected output is not returned, the test should fail
148-
- if there is a clear dependency between tool calls, you can chain them using the "calls" property
149-
- Run the tests and confirm that the syntax is correct and that each test runs (they do not have to pass)
145+
1. Create tool tests
146+
- Create a file called `tool-tests.yaml` that contains a single test for each tool. Follow these guidelines:
147+
- Do NOT force an individual test to pass; if the expected output is not returned, the test should fail
148+
- if there is a clear dependency between tool calls, you can chain them using the "calls" property
149+
- Run the tests and confirm that the syntax is correct and that each test runs (they do not have to pass)
150150

151-
2. Create eval tests
152-
- Create a file called `eval-tests.yaml` with eval tests that will test the server's behavior. Follow these guidelines:
153-
- start with a few simple evals, and then build up to more complex ones
154-
- create between 5 and 10 eval tests
155-
- Run the tests and confirm that the syntax is correct and that each test runs (they do not have to pass)
151+
2. Create eval tests
152+
- Create a file called `eval-tests.yaml` with eval tests that will test the server's behavior. Follow these guidelines:
153+
- start with a few simple evals, and then build up to more complex ones
154+
- create between 5 and 10 eval tests
155+
- Run the tests and confirm that the syntax is correct and that each test runs (they do not have to pass)
156156

157-
3. Provide a summary, which includes:
158-
- a list of the tools that are being tested and what you chose to test
159-
- a list of the eval tests and your reasoning for why you chose them
160-
- an explanation of how to run the tool tests and eval tests
161-
```
157+
3. Provide a summary, which includes:
158+
- a list of the tools that are being tested and what you chose to test
159+
- a list of the eval tests and your reasoning for why you chose them
160+
- an explanation of how to run the tool tests and eval tests
161+
```
162162
163-
3. **Run tests**:
163+
4. **Run tests**:
164164
165165
```bash
166166
# Run tools tests (fast, no API key needed)
@@ -326,6 +326,7 @@ response_scorers:
326326
### Advanced Options
327327

328328
**IDE Schema Validation**
329+
329330
Add this line to the top of your test files to enable automatic schema validation and autocomplete in IDEs like VS Code:
330331

331332
```

0 commit comments

Comments
 (0)