Effect CommunityEC
Effect Community4w ago
3 replies
marco.arnold

Http mcp server interop with python mcp client

Hi, I built an MCP server with @effect/ai.
MCP Inspector and Claude Code can connect to the server and use the tools—no problem.
Now I want to use this MCP server from Python and I’m running into issues.

Python/pydantic is complaining that the response from the JsonRpc method initialize is wrapped in an array.

I broke the communication down to make it easily reproducible.

Here’s a minimal example:
import { createServer } from 'node:http';
import { McpServer } from '@effect/ai';
import { HttpRouter } from '@effect/platform';
import { NodeHttpServer, NodeRuntime } from '@effect/platform-node';
import { Layer } from 'effect';

const ServerLayer = Layer.mergeAll(HttpRouter.Default.serve()).pipe(
  Layer.provide(
    McpServer.layerHttp({
      name: 'Demo Server',
      version: '1.0.0',
      path: '/mcp',
    }),
  ),
  Layer.provide(NodeHttpServer.layer(createServer, { port: 3000 })),
);

Layer.launch(ServerLayer).pipe(NodeRuntime.runMain);


Here’s the curl call for a request:
curl -X POST 'http://localhost:3000/mcp' -H 'content-type: application/json' -d '{"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"mcp","version":"0.1.0"}},"jsonrpc":"2.0","id":0}'


And here’s the response, wrapped in an array:
[{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":"2025-06-18","capabilities":{"completions":{}},"serverInfo":{"name":"Demo Server","version":"1.0.0"}}}]


What’s wrong?
Was this page helpful?