Title: MCP Protocol Validation Error During Initialization · Issue #1 · DGdev91/java-mcp-sql-server · GitHub
Open Graph Title: MCP Protocol Validation Error During Initialization · Issue #1 · DGdev91/java-mcp-sql-server
X Title: MCP Protocol Validation Error During Initialization · Issue #1 · DGdev91/java-mcp-sql-server
Description: Summary The Java MCP SQL Server successfully connects to the database and all tools are functional, but Cursor IDE shows a protocol validation error during initialization with a red error indicator. The error occurs during the MCP handsh...
Open Graph Description: Summary The Java MCP SQL Server successfully connects to the database and all tools are functional, but Cursor IDE shows a protocol validation error during initialization with a red error indicator...
X Description: Summary The Java MCP SQL Server successfully connects to the database and all tools are functional, but Cursor IDE shows a protocol validation error during initialization with a red error indicator...
Opengraph URL: https://github.com/DGdev91/java-mcp-sql-server/issues/1
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"MCP Protocol Validation Error During Initialization","articleBody":"## Summary\nThe Java MCP SQL Server successfully connects to the database and all tools are functional, but Cursor IDE shows a protocol validation error during initialization with a red error indicator. The error occurs during the MCP handshake but the server recovers and continues to work normally.\n\n## Environment\n- **OS**: Windows 10 (Build 19045)\n- **Java Version**: openjdk version \"21.0.4\" 2024-07-16 LTS\n- **MCP Server Version**: 1.0.0\n- **JAR Location**: `C:\\java-mcp-sql-server-1.0.0.jar`\n- **Database**: Oracle \n- **Cursor IDE**: 2.2.43\n\n## Configuration\n```json\n{\n \"java-mcp-sql-server\": {\n \"command\": \"java\",\n \"args\": [\"-jar\", \"C:\\\\java-mcp-sql-server-1.0.0.jar\"],\n \"env\": {\n \"JMCP_JDBC_URL\": \"jdbc:oracle:thin:@//your-server:1521/your-database\",\n \"JMCP_DB_USERNAME\": \"YOUR_USERNAME\",\n \"JMCP_DB_PASSWORD\": \"YOUR_PASSWORD\",\n \"JMCP_MODE\": \"stdio\",\n \"JMCP_QUERY_SELECT_ONLY\": \"false\"\n }\n }\n}\n```\n\n## Error Details\n\n### Server Startup (Successful)\n```\n23:47:21.222 [main] INFO com.dgdev91.mcpsql.SqlMcpServer - Starting SQL MCP Server...\n23:47:21.481 [main] INFO com.dgdev91.mcpsql.service.DatabaseService - Oracle driver loaded successfully\n23:47:23.111 [main] INFO com.dgdev91.mcpsql.service.DatabaseService - Successfully connected to database: ORACLE\n23:47:23.242 [main] INFO com.dgdev91.mcpsql.SqlMcpServer - Database connection successful. Type: ORACLE, Query SELECT only: false\n```\n\n### Protocol Validation Error\nCursor IDE reports a Zod validation error during initialization:\n\n```json\n{\n \"code\": \"invalid_union\",\n \"unionErrors\": [\n {\n \"issues\": [\n {\n \"code\": \"invalid_union\",\n \"unionErrors\": [\n {\n \"issues\": [\n {\n \"code\": \"invalid_type\",\n \"expected\": \"string\",\n \"received\": \"null\",\n \"path\": [\"id\"],\n \"message\": \"Expected string, received null\"\n }\n ],\n \"name\": \"ZodError\"\n },\n {\n \"issues\": [\n {\n \"code\": \"invalid_type\",\n \"expected\": \"number\",\n \"received\": \"null\",\n \"path\": [\"id\"],\n \"message\": \"Expected number, received null\"\n }\n ],\n \"name\": \"ZodError\"\n }\n ],\n \"path\": [\"id\"],\n \"message\": \"Invalid input\"\n },\n {\n \"code\": \"invalid_type\",\n \"expected\": \"string\",\n \"received\": \"undefined\",\n \"path\": [\"method\"],\n \"message\": \"Required\"\n },\n {\n \"code\": \"unrecognized_keys\",\n \"keys\": [\"error\"],\n \"path\": [],\n \"message\": \"Unrecognized key(s) in object: 'error'\"\n }\n ],\n \"name\": \"ZodError\"\n }\n ],\n \"path\": [],\n \"message\": \"Invalid input\"\n}\n```\n\n### Recovery (Successful)\nAfter the error, the server recovers:\n```\n23:47:24.394 [info] Handling ListOfferings action, server stored: true\n23:47:24.402 [info] listOfferings: Found 5 tools\n23:47:24.402 [info] Found 5 tools, 0 prompts, and 0 resources\n```\n\n## Expected Behavior\nThe MCP server should initialize without protocol validation errors. All messages sent during initialization should conform to the MCP protocol specification.\n\n## Actual Behavior\n- Server starts successfully ✅\n- Database connection established ✅\n- Tools are available and functional ✅\n- Protocol validation error during initialization ❌\n- Red error indicator in Cursor IDE ❌\n\n## Impact\n- **Severity**: Low (cosmetic issue)\n- **Functionality**: All tools work correctly after initialization\n- **User Experience**: Red error indicator is misleading and concerning\n\n## Steps to Reproduce\n1. Configure `mcp.json` with java-mcp-sql-server\n2. Restart Cursor IDE\n3. Check MCP server logs in Cursor\n4. Observe protocol validation error during initialization\n5. Verify tools are still functional (they are)\n\n## Additional Notes\n- The error appears to be related to a message sent during initialization that contains an `\"error\"` key with a `null` id\n- The server appears to send a non-standard message format that doesn't match MCP protocol expectations\n- This might be related to error handling or logging during the initialization phase\n- All 5 tools (`list_schemas`, `list_tables`, `get_table_structure`, `query_table`, `execute_query`) work correctly after initialization\n\n\n\n---\n\n**Note**: This issue was identified while using the server with Oracle database, but it may affect other database types as well.\n\n","author":{"url":"https://github.com/ahmed98Osama","@type":"Person","name":"ahmed98Osama"},"datePublished":"2025-12-23T22:02:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1/java-mcp-sql-server/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:56a3b8a8-a058-d941-7345-f59ba13f8e08 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D12C:268A21:79618F:A4199A:6A53045B |
| html-safe-nonce | a55559a79b438af071d606b732035dcf64aea2fd273a2adf6ff06457563fe9f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTJDOjI2OEEyMTo3OTYxOEY6QTQxOTlBOjZBNTMwNDVCIiwidmlzaXRvcl9pZCI6IjgyMTI5NjE4OTk3MTQ5MDUxNzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 179790274de5b0fed2ad40a6a04f05b909fd34a52356c0db95c8548feb358d90 |
| hovercard-subject-tag | issue:3758681477 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/DGdev91/java-mcp-sql-server/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3abac178e8017ac3184c4148958fdb2438ea58d0cc9e3beba5e14b70ec9fc3f8/DGdev91/java-mcp-sql-server/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3abac178e8017ac3184c4148958fdb2438ea58d0cc9e3beba5e14b70ec9fc3f8/DGdev91/java-mcp-sql-server/issues/1 |
| og:image:alt | Summary The Java MCP SQL Server successfully connects to the database and all tools are functional, but Cursor IDE shows a protocol validation error during initialization with a red error indicator... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ahmed98Osama |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/DGdev91/java-mcp-sql-server git https://github.com/DGdev91/java-mcp-sql-server.git |
| octolytics-dimension-user_id | 428479 |
| octolytics-dimension-user_login | DGdev91 |
| octolytics-dimension-repository_id | 1109147634 |
| octolytics-dimension-repository_nwo | DGdev91/java-mcp-sql-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1109147634 |
| octolytics-dimension-repository_network_root_nwo | DGdev91/java-mcp-sql-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width