diff --git a/template/README.md.ejs b/template/README.md.ejs index ae94532..2de1440 100644 --- a/template/README.md.ejs +++ b/template/README.md.ejs @@ -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. diff --git a/template/package.json.ejs b/template/package.json.ejs index 7012902..1eb244a 100644 --- a/template/package.json.ejs +++ b/template/package.json.ejs @@ -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" diff --git a/template/src/index.ts.ejs b/template/src/index.ts.ejs index 6eca196..101a553 100644 --- a/template/src/index.ts.ejs +++ b/template/src/index.ts.ejs @@ -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: