MCP tool usage results in code: ErrorCode(-32603)

We’re currently receiving the following error starting the router/mcp locally:

rover dev
–graph-ref XXXXXXXXXX
–supergraph-config supergraph_config_local.yaml
–router-config config_local.yaml
–mcp
–mcp-port 5000
–mcp-introspection
–mcp-collection XXXXX
–mcp-header “Authorization: Bearer XXXXXXXXX”
–log=info

MCP Tools are registered and listed in @modelcontextprotocol/inspector

Running the tool results in:

WARN response error id=2 error=ErrorData { code: ErrorCode(-32603), message: "Failed to read GraphQL response body: error decoding response body", data: None }

router v2.3.0
rover v0.34.1

Any assistance/guidance would be appreciated!

Hey @Super_Space, I’m looking into it and seeing if I can reproduce something on my end.

Hey @Super_Space, I wasn’t able to reproduce this error myself (although I did find something else that I reported :folded_hands:).

Would you be able to maybe DM me and tell me more about which graph/collection you were pointing at and what your supergraph_config_local.yaml looks like? I would like to dive deeper and I think the reproduction is probably with a details somewhere in those pieces I can’t see.

I am also experiencing this issue with authentication

Hey folks - I actually am running into this as well and I believe I know what the issue is…

I can reproduce this by using a custom path in my router config:
supergraph:
listen: “127.0.0.1:4000”
path: “/graphql”

In the MCP, I have it configured to hit that endpoint using:
endpoint: “http://127.0.0.1:4000/graphql”

However, it doesn’t appear to respect that configure. If you remove the custom path in the router to just:
supergraph:
listen: “127.0.0.1:4000”

everything works fine, even if you leave the endpoint configuration in the MCP server. Would love to see a patch to actually recognize that config, documented here as a top-level option: Config File Reference - Apollo GraphQL Docs

CC: @watson ^^^^ take a look at the above. I was able to reproduce using pretty easily with a simple example. Happy to chat if you want.

If folks need a work around short term, in the docker file I use to build my MCP container (which doesn’t serve DIRECT production router graph traffic), I added the below steps (using the apollo-runtime docker image). All this does is remove lines in the router.yaml that match “path: /graphql”:

RUN mkdir -p /tmp
COPY router.yaml /tmp/router_original.yaml
RUN grep -v “path: /graphql” /tmp/router_original.yaml > /config/router_config.yaml

Also - I just realized how old this original post is… it’s worth calling out I’m reproducing this with:
router: v2.7.0
mcp-server: v1.0.0

1 Like

Hi @Super_Space,@riginoommen and @mjfaga! :waving_hand:

Thanks for reporting this issue and especially to @mjfaga for the detailed investigation into the custom path configuration. After looking into this, I can confirm the root cause. We need to update rover dev to automatically handle this by parsing the router config to detect custom paths.

We’re planning to work on a fix in rover dev so that the command can automatically recognize that your router serves at /graphql and configure the MCP server’s endpoint accordingly. I’ll follow up here once we have more updates on the fix!

1 Like

In my case

I start my router with ./apollo-mcp-server mcp.yaml not with the rover dev command

Hi All,

Just wanted to share that we shipped a fix in Rover v0.37.0 (released yesterday) that addresses this issue. With the latest version, rover dev automatically detects and uses the router’s custom path, so everything should work seamlessly without workarounds.

Please let us know if this fix works for you.