Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@johnstcn
Copy link
Contributor

@johnstcn johnstcn commented Apr 6, 2025

While attempting to use the read-resource command to troubleshoot an issue with an MCP server I am currently working on, I was seeing the following error (mcptools dev@5d86d52):

$ mcptools read-resource 'coder://user/me' path/to/my/mcp/server
Error: invalid JSON for params: invalid character 'p' looking for beginning of value

Upon closer inspection, it appears the read-resource command was trying to marshal the required commands to run the given MCP server as JSON. I could not find any reason to do this -- it seems to have been an errant copy-pasta after recent refactors? After removing it, the command worked for me. I also fixed up a couple of other things while I was in the area.

  • cmd/mcptools/commands:
    • Removes errant json.Unmarshal of parsedArgs in ReadResourceCmd()
    • Adds test for ReadResourceCmd()
  • pkg/jsonutils:
    • Fixes incorrect column alignment in formatGenericMap() due to colour escape sequences.

@f f merged commit ae693ec into f:master Apr 6, 2025
2 checks passed
@johnstcn johnstcn deleted the cj/fix/cmd-read-resource branch April 6, 2025 17:02
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.

2 participants