Skip to content

Conversation

@prosdev
Copy link
Collaborator

@prosdev prosdev commented Nov 24, 2025

Problem

The MCP server was immediately disconnecting when Cursor tried to connect, resulting in 'No server info found' errors. This was due to several issues:

  1. Protocol version mismatch: We were responding with '1.0' but Cursor expects date-based versioning (e.g., '2025-06-18')
  2. Missing notification handler: The initialized notification wasn't being handled, causing Cursor to close the connection
  3. Stdout interference: Logger was writing to stdout, corrupting JSON-RPC messages
  4. Readline output: readline was configured to echo to stdout

Solution

  • Echo back the client's protocol version instead of hardcoding '1.0'
  • Add explicit handling for the initialized notification
  • Fix logger to write all messages to stderr (not stdout)
  • Remove readline output configuration to prevent echoing
  • Enable debug logging to aid future troubleshooting
  • Add CLI entry point (dev-agent-mcp.ts) for starting the server

Testing

✅ MCP server successfully connects to Cursor
dev_search tool is discovered and functional
✅ End-to-end search works in Cursor chat
✅ All pre-commit hooks pass (linting + type checking)

Related Issues

Fixes issues discovered during dogfooding of the MCP server integration (Issues #27, #28).

- Echo back client's protocol version (MCP uses date-based versioning like '2025-06-18')
- Add handling for 'initialized' notification to prevent premature connection closure
- Enable debug logging to aid troubleshooting
- Fix logger to write all messages to stderr (not stdout) to avoid JSON-RPC interference
- Remove readline output config to prevent echoing to stdout
- Add CLI entry point (dev-agent-mcp.ts) for starting the MCP server

This fixes the issue where Cursor would immediately close the MCP server connection
due to protocol version mismatch and improper stdout usage. The server now successfully
connects to Cursor and the dev_search tool is fully functional.
@prosdev prosdev merged commit ffbc759 into main Nov 24, 2025
1 check passed
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.

1 participant