Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MCP inspector connection with TypeScript SDK server #135

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jasonkneen
Copy link

@jasonkneen jasonkneen commented Jan 22, 2025

Fixes #129

Update README.md to include instructions for running the server with the MCP inspector and update the quickstart example.

  • Add instructions for running the server with the MCP inspector.
  • Update the quickstart example to include the StdioServerTransport connection.
  • Add sections for Development Mode, Claude Desktop Integration, and Direct Execution.

For more details, open the Copilot Workspace session.

Fixes modelcontextprotocol#129

Update README.md to include instructions for running the server with the MCP inspector and update the quickstart example.

* Add instructions for running the server with the MCP inspector.
* Update the quickstart example to include the `StdioServerTransport` connection.
* Add sections for Development Mode, Claude Desktop Integration, and Direct Execution.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/modelcontextprotocol/typescript-sdk/issues/129?shareId=XXXX-XXXX-XXXX-XXXX).
* **Running with MCP Inspector**
  - Add steps to install MCP Inspector globally using npm
  - Add steps to start the MCP server
  - Add steps to start the MCP Inspector and connect it to the running server
Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I've incorporated part of the change here into #136.

Unfortunately, the additions to "Running Your Server" seem to assume a particular package.json setup (e.g., dev and start scripts, dist/ directory), which the user might not have done.

If you want to document how to do those things, though, we could keep these as a follow-up. What are your thoughts?

Comment on lines +76 to +77
const transport = new StdioServerTransport();
await server.connect(transport);
Copy link

@tpina tpina Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const transport = new StdioServerTransport();
await server.connect(transport);
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
};
// invoke main method
main().catch((error) => {
console.error("Fatal error in main():", error);
process.exit(1);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to run MCP inspector with TypeScript SDK servers?
3 participants