Merge pull request #5 from modelcontextprotocol/justin/inspector-shortcut

Add script shortcut to launch the inspector
This commit is contained in:
Justin Spahr-Summers 2024-11-20 21:55:53 +00:00 • committed by GitHub
commit 6b3fc69e67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -61,10 +61,10 @@ On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
### Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector):
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), which is available as a package script:
```bash
npx @modelcontextprotocol/inspector /path/to/<%= name %>/build/index.js
npm run inspector
```
The Inspector will provide a URL to access debugging tools in your browser.

View file

@ -13,7 +13,8 @@
"scripts": {
"build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",
"prepare": "npm run build",
"watch": "tsc --watch"
"watch": "tsc --watch",
"inspector": "npx @modelcontextprotocol/inspector build/index.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "0.6.0"

View file

@ -1,3 +1,5 @@
#!/usr/bin/env node
/**
* This is a template MCP server that implements a simple notes system.
* It demonstrates core MCP concepts like resources and tools by allowing: