这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@finleyjchen
Copy link
Contributor

When using the mcp-adapter in Cursor, ran into issues detecting the tool. The error looks like this: {"error": "MCP error -32600: Tool <name> has an output schema but did not return structured content"}.

I was reading here:
https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content
modelcontextprotocol/typescript-sdk#911

and found that Cursor and other IDE's handle their MCP implementation inconsistently. VS Code did not have this error, because it seems to not check for existence of outputSchema and expect a structuredContent object, while Cursor does.

Adding structuredContent to the output fixes it.

I have tested this when creating a tool that has no outputSchema, and it still seems to work just fine. It may need to be improved to check for outputSchema first before including structuredContent

@github-actions
Copy link

github-actions bot commented Sep 1, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: finleyjchen <inlorfaze@git.wordpress.org>
Co-authored-by: jonathanbossenger <psykro@git.wordpress.org>
Co-authored-by: stormrockwell <stormrockwell@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@jonathanbossenger
Copy link
Collaborator

@finleyjchen can you confirm this error happens when you try and use the tool, not when Cursor first connects to the server to list the tools.

I'm only seeing this error when I try to use a tool in the Cursor agent, so I just want to make sure I'm testing the right things.

@jonathanbossenger
Copy link
Collaborator

I also might have to wait for #36 to get merged before I can test this.

@stormrockwell
Copy link
Contributor

@jonathanbossenger, that's the case for me. Once tools are available (#36) I get an error that structuredContent is missing when using tools, and this fixes it.
image

@jonathanbossenger
Copy link
Collaborator

Happy to report that my testing was successful

Claude desktop
claude-desktop

Cursor
cursor

VS Code
vs-code

@jonathanbossenger jonathanbossenger merged commit 40d7b14 into WordPress:trunk Sep 5, 2025
2 of 17 checks passed
@justlevine
Copy link
Contributor

Hey @finleyjchen, @stormrockwell, @jonathanbossenger - I am so terribly sorry, something went wrong with the merge and the authorship/props were lost. We're working to get the commit meta corrected ASAP, so your contributions are correctly recognized.

@finleyjchen thank you so much for contributing this fix, and @stormrockwell and @jonathanbossenger thanks both of you for your review and testing 🙇‍♂️

We'll comment back here once the commit is amended.

justlevine added a commit to justlevine/mcp-adapter that referenced this pull request Sep 8, 2025
This PR restores the props that got squashed off of the merges from WordPress#36 and WordPress#37

Co-authored-by: finleyjchen <inlorfaze@git.wordpress.org>
Co-authored-by: jonathanbossenger <psykro@git.wordpress.org>
Co-authored-by: stormrockwell <stormrockwell@git.wordpress.org>
justlevine added a commit that referenced this pull request Sep 8, 2025
This PR restores the props that got squashed off of the merges from #36 and #37

Co-authored-by: finleyjchen <inlorfaze@git.wordpress.org>
Co-authored-by: jonathanbossenger <psykro@git.wordpress.org>
Co-authored-by: stormrockwell <stormrockwell@git.wordpress.org>
@justlevine
Copy link
Contributor

We were unable to --amend this merge itself, so it's backfilled via #41

95981e8

image

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.

4 participants