Skip to content

Commit 9a22b03

Browse files
committed
Added documentation command for tool
1 parent 67bed6f commit 9a22b03

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Try out this prompt, replacing the server config information with your own:
132132

133133
```
134134
Please create tool tests and eval tests for me to use with the mcp server tester tool.
135-
To see how to use it, read the documentation at: https://github.com/steviec/mcp-server-tester/ and then run:
135+
To see how to use it, run the tool's documentation and schema commands:
136136
137137
`npx -y mcp-server-tester --help`
138138

src/cli.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const __filename = fileURLToPath(import.meta.url);
2222
const __dirname = dirname(__filename);
2323
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
2424

25-
const GITHUB_HELP_TEXT = `Learn more:\n For detailed examples and documentation see the README at https://github.com/steviec/mcp-server-tester`;
25+
const GITHUB_HELP_TEXT = `Learn more:\n For detailed examples see the README at https://github.com/steviec/mcp-server-tester`;
2626

2727
interface CliOptions {
2828
serverConfig: string;
@@ -238,6 +238,7 @@ Examples:
238238
$ mcp-server-tester evals eval.yaml --server-config server.json
239239
$ mcp-server-tester compliance --server-config server.json
240240
$ mcp-server-tester schema
241+
$ mcp-server-tester documentation
241242
242243
${GITHUB_HELP_TEXT}`
243244
);
@@ -331,6 +332,22 @@ ${GITHUB_HELP_TEXT}`
331332
console.log('```');
332333
});
333334

335+
// Documentation command
336+
program
337+
.command('documentation')
338+
.alias('docs')
339+
.description('Display full documentation for MCP Server Tester')
340+
.action(() => {
341+
try {
342+
const readmePath = join(__dirname, '../README.md');
343+
const readmeContent = readFileSync(readmePath, 'utf8');
344+
console.log(readmeContent);
345+
} catch (error) {
346+
console.error('Error reading README.md:', error);
347+
process.exit(1);
348+
}
349+
});
350+
334351
// Parse command line arguments
335352
program.parse();
336353
}

0 commit comments

Comments
 (0)