x2mcp 0.1.0-beta.1
dotnet tool install --global x2mcp --version 0.1.0-beta.1
dotnet new tool-manifest
dotnet tool install --local x2mcp --version 0.1.0-beta.1
#tool dotnet:?package=x2mcp&version=0.1.0-beta.1&prerelease
nuke :add-package x2mcp --version 0.1.0-beta.1
x2mcp
⚠️ Beta release
x2mcpis in beta (0.1.0-beta). It's had a manual QA pass across all five supported languages— expect rough edges, and expect breaking changes before a 1.0 release. Please open an issue if something breaks.
Create a native-language MCP server wrapper around any language
x2mcp scans an existing source file or project, discovers its public
functions/methods, and generates a self-contained, stateless Model Context
Protocol (MCP) server that exposes them as MCP
tools — without touching or forking your original code. It emits a small wrapper
project next to your source, wires up the target language's native MCP SDK, and
builds it into a runnable server binary using that language's own toolchain.
How it works
- Detect — the source path's file extensions are matched against a language module (C#, Python, Go, Rust, Ruby).
- Scan — the module's scanner walks the source and produces a surface of public types and functions (for C#, this is a Roslyn syntax-tree walk).
- Emit — the module's wrapper emitter generates a companion project: an entry point that starts an MCP server plus one tool class per scanned type, each method delegating straight to your original code.
- Build —
x2mcpshells out to the language's own toolchain (e.g.dotnet publish,go build,cargo build,pyinstaller) to produce a runnable server at the requested output path.
Supported languages
| Language | Transports | Example |
|---|---|---|
| C# (.NET) | stdio, http | docs/examples/csharp.md |
| Go | stdio, http | docs/examples/go.md |
| Python | stdio, http | docs/examples/python.md |
| Ruby | stdio | docs/examples/ruby.md |
| Rust | stdio, http | docs/examples/rust.md |
Installation
x2mcp is published as a .NET global tool.
Prerequisite: .NET 10 SDK or later.
While x2mcp is in beta, no stable version exists yet — dotnet tool install/update
only consider stable versions by default, so the plain form of these commands will
fail with "package not found" until 1.0 ships. Pass --prerelease (or pin an exact
--version) until then:
dotnet tool install --global --prerelease x2mcp
Upgrade to the latest version at any time with:
dotnet tool update --global --prerelease x2mcp
CLI syntax
x2mcp <source> [--out-dir <path>] [--transport <stdio|http>] [--name <name>]
| Argument / Option | Required | Default | Description |
|---|---|---|---|
<source> |
yes | — | Path to the source file or directory to wrap |
--out-dir <path> |
no | ./dist/<name>-mcp |
Output directory for the built MCP server |
--transport <stdio\|http> |
no | stdio |
Transport the generated server uses |
--name <name> |
no | source file/directory name | Server name |
Example
x2mcp ./Calculator --out-dir ./dist/calculator-mcp --name calculator --transport stdio
Scanning ./Calculator...
Detected language: C#
Creating stdio server...
Done. MCP server written to: ./dist/calculator-mcp
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.1 | 71 | 8/21/2026 |
Early beta — manually QA'd across all five supported languages but expect rough edges and breaking changes.