CodeSampleX
MCP server that helps coding LLMs avoid re-solving common problems by serving verified minimal code samples and compatibility evidence, with tools to search, retrieve, and explain known solutions across languages and environments.
README
CodeSampleX
Stop solving the same code twice.
Languages: English · 한국어 · 日本語 · 简体中文 · Español · Français · Deutsch · Português (BR) · Русский
CodeSampleX is a local-first distributed reasoning cache for coding LLMs. Instead of every agent on Earth re-deriving how a public library works — and re-hitting the same version incompatibilities — CodeSampleX collects anonymous compatibility Evidence from real development environments and serves verified minimal Samples with the exact delta between a known-good answer and your project.
- Website & Compatibility Explorer: https://codesamplex.dev
- One question your LLM stops re-answering: does
axios.postactually work on axios 1.12 + Node 22 + pnpm + Windows 11 — and if not, at which stage does it break? - Works with Claude Code, Codex, Gemini CLI, OpenCode — and any MCP client (Cursor, Windsurf, Cline, Zed, VS Code).
Install
Windows (PowerShell):
irm https://codesamplex.dev/install.ps1 | iex
macOS / Linux:
curl -fsSL https://codesamplex.dev/install.sh | sh
One binary, one question. csx init shows the community contract and asks a single choice — JOIN COMMUNITY or LOCAL ONLY. Everything else (daemon, MCP registration for Claude Code / Codex / Gemini CLI / OpenCode, agent rules) is automatic.
For scripted or CI setups: csx init --community --yes --no-agents does config + identity only and writes nothing outside CSX_HOME; agent config paths otherwise honor CSX_AGENT_HOME when you need them somewhere other than your OS user home.
The contract
You get You contribute
✓ Public compatibility knowledge ✓ Public package/version usage
✓ Verified code answers ✓ Public API/symbol usage when detectable
✓ Local agent integration ✓ Build/typecheck/test result
✓ Public sample cache ✓ Sanitized failure fingerprints
Never shared automatically
✕ Source code ✕ Repository/project name ✕ File names or paths
✕ Source snippets ✕ Secrets or env variables ✕ Private packages
✕ Raw compiler/runtime logs
This is not hidden telemetry — it is the protocol. Community peers are consumers and producers. Local-only mode never sends anything. The privacy preview in csx ui shows the exact payloads before they leave your machine.
How it works
you build/test through csx (or your agent does)
→ local analysis: public packages, lockfile-resolved versions, symbols, environment
→ raw errors sanitized locally into fingerprints (paths/names/secrets stripped)
→ anonymous evidence batches → Compatibility Graph on codesamplex.dev
→ your LLM asks CSX first: nearest verified Sample + environment delta
→ it reasons about the DELTA, not the whole problem
Four layers, kept honestly separate:
| Layer | What it is | Trust |
|---|---|---|
| Evidence Network | anonymous package/version/symbol/env/stage/result facts | weak→strong, class-labeled |
| Compatibility Graph | aggregated probabilistic map per environment (incl. execution context: Node/Chrome/Safari/Electron/…) | derived view |
| Sample Pool | user-approved, clean-room, content-addressed minimal projects | contract-verified, cross-verified |
| Agent Delivery | MCP/CLI: nearest sample + delta + known failures | graded EXACT→NO_SAFE_MATCH |
A project compiling is never presented as a symbol working. Unknown causes stay UNKNOWN. A wrong HIT is worse than a MISS — NO_SAFE_MATCH is a feature.
Agent integration (MCP)
Configured automatically by csx init: Claude Code · Codex · Gemini CLI · OpenCode.
Any other MCP client — Cursor, Windsurf, Cline, Zed, VS Code — works too; csx is a standard stdio MCP server:
{"mcpServers": {"csx": {"command": "csx", "args": ["mcp"]}}}
Model-agnostic: the same compatibility evidence serves Claude, GPT and Codex, Gemini, Llama — any model that can call an MCP tool.
Clients that install MCPB bundles can use codesamplex-mcp.mcpb from the latest release instead. It carries one binary per platform (darwin-arm64, linux-amd64, windows-amd64); on any other architecture use the install script above.
Tools: search_known_solution, get_sample, explain_compatibility, run_observed_command, report_sample_adoption, propose_public_sample, list_local_hits, get_local_stats. Publishing a sample is deliberately not an MCP capability — it requires your explicit CLI approval after a full preview.
csx run -- pnpm build # observed build → evidence
csx search "axios multipart upload"
csx sample propose --goal "upload a file with axios"
csx ui # dashboard + privacy preview
Ecosystems (Public v1)
Node/TypeScript (npm, pnpm, yarn — reference), Python (pip, uv), Go, Rust/Cargo. Honest capability matrix: docs/adapters.md — no adapter claims runtime symbol instrumentation in v1, and symbol resolution confidence is always labeled (EXACT/PROBABLE/UNKNOWN).
Architecture
Single Go binary (csx: daemon + CLI + MCP + peer node + verifier) and a small server (csx-server: PostgreSQL + server-rendered explorer behind Caddy). Samples are content-addressed (sha256) and distributed local-cache-first → peers → main seeder. Downloaded samples never run on your host directly — resolve with --ignore-scripts, compile and contract run network-off in a sandbox, receipts are ed25519-signed. See goal.md (product spec), docs/execution-context.md, docs/operations.md.
Building from source
go build ./cmd/csx && go build ./cmd/csx-server
go test ./...
License
Code: Apache-2.0. Published samples default to MIT-0.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。