You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
I used the script in the README.md to write a demo on MacOS
#!/usr/bin/env node
import{Server}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{ListResourcesRequestSchema,ReadResourceRequestSchema,}from'@modelcontextprotocol/sdk/types.js';// Server setupconstserver=newServer({name: 'mcp-server-nocobase',version: '1.0.0',},{capabilities: {resources: {},},},);server.setRequestHandler(ListResourcesRequestSchema,async()=>{return{resources: [{uri: 'file:///example.txt',name: 'Example Resource',},],};});server.setRequestHandler(ReadResourceRequestSchema,async(request)=>{if(request.params.uri==='file:///example.txt'){return{contents: [{uri: 'file:///example.txt',mimeType: 'text/plain',text: 'This is the content of the example resource.',},],};}else{thrownewError('Resource not found');}});consttransport=newStdioServerTransport();awaitserver.connect(transport);
Describe the bug
A clear and concise description of what the bug is.
I used the script in the
README.md
to write a demo on MacOSAnd I configure
claude_desktop_config.json
When I restarted the Claude Desktop, it occurred an error "Could not attach to MCP server demo".
I had also try
npm link
and setTo Reproduce
Steps to reproduce the behavior:
1.
Expected behavior
A clear and concise description of what you expected to happen.
It is expected to work when using Claude desktop on MacOS.
Logs
If applicable, add logs to help explain your problem.
mcp.log
showed2024-12-06T21:01:51.571Z [info] Attempting to connect to MCP server demo... 2024-12-06T21:01:51.578Z [info] Connected to MCP server demo!
mcp-server-demo.log
showed nothing.Additional context
Add any other context about the problem here.
The project works well when using
@modelcontextprotocol/inspector
I had followed some other issues like modelcontextprotocol/servers#40 and try to fix the issue, but none of them works for me.
The text was updated successfully, but these errors were encountered: