Skip to content

Commit

Permalink
Merge pull request #5 from modelcontextprotocol/justin/inspector-shor…
Browse files Browse the repository at this point in the history
…tcut

Add script shortcut to launch the inspector
  • Loading branch information
jspahrsummers authored Nov 20, 2024
2 parents ae3c0c8 + 61d7261 commit 6b3fc69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions template/README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion template/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions template/src/index.ts.ejs
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 6b3fc69

Please sign in to comment.