Transports

Customize the transport types for your MCP server.

HTTP transport

The http configuration customizes the HTTP server. Set it to true to use defaults, or provide an object to override specific options:

xmcp.config.ts

These are the default values. Override only what you need to customize.

CORS

CORS (Cross-Origin Resource Sharing) middleware that can be configured to control cross-origin requests.

xmcp.config.ts

STDIO transport

The stdio configuration customizes the STDIO transport. Set it to true to use defaults, or provide an object to override specific options:

By default you enable STDIO transport by setting it to true.

xmcp.config.ts

You can also customize the debug mode and this would enable it as well.

xmcp.config.ts

Silent mode

When using STDIO transport, any console.log, console.debug, console.info, console.warn, or console.error calls in your tool handlers will write to stdout, which interferes with the MCP protocol. Enable silent to automatically redirect all console output to stderr instead:

xmcp.config.ts

This is useful when your tools or dependencies contain debug logs that would otherwise corrupt the MCP communication. The logs are not lost, they are still visible in stderr.

Troubleshooting

Keep in mind that clients like Claude Desktop are not compatible with STDIO logging and would cause a JSON parsing error. You can use the silent option to redirect console output to stderr and avoid this issue.

On this page

One framework to rule them all