通过编组现有的MCP工具来构建代理-MCP服务器.
Build agentic MCP servers by composing existing MCP tools.
MCPC is the SDK for building agentic MCP (Model Context Protocol) Servers. You can use it to:
agentic), AI SDK sampling (ai_sampling), AI
ACP mode (ai_acp), secure code execution
(code_execution), and sandbox + sampling
(code_execution_sampling) - each
with dedicated implementationsVisit mcpc.tech to browse servers from the official MCP registry, discover tools, and generate ready-to-use agents.
Let AI help you discover servers and build agents:
Add to your MCP client:
{
"mcpServers": {
"mcpc-builder-agent": {
"command": "npx",
"args": ["-y", "@mcpc-tech/builder", "mcpc-builder-agent"]
}
}
}Use the SDK directly for complete customization. See examples below.
# npm (from npm registry)
npm install @mcpc-tech/core
# npm (from jsr)
npx jsr add @mcpc/core
# deno
deno add jsr:@mcpc/core
# pnpm (from npm registry)
pnpm add @mcpc-tech/core
# pnpm (from jsr)
pnpm add jsr:@mcpc/coreOr run directly with the CLI (no installation required):
# Run with remote configuration
npx -y @mcpc-tech/cli --config-url \
"https://raw.githubusercontent.com/mcpc-tech/mcpc/main/packages/cli/examples/configs/codex-fork.json"…Complete Example: See the full Codex fork tutorial.
Install the mcpc-core skill into your project using
skills.sh:
npx skills add mcpc-tech/mcpcThis installs the skill into .agents/skills/mcpc-core/, giving your agent
on-demand access to the full @mcpc/core API reference, usage patterns, plugin
guide, and gotchas.
For complex agents where inline description becomes unwieldy, use
Agent Skills to organize domain knowledge in separate
files that are loaded on-demand.
import { createBashPlugin, createSkillsPlugin } from "@mcpc/core/plugins";
const server = await mcpc(
[{ name: "my-agent", version: "1.0.0" }, { capabilities: { tools: {} } }],
[{
name: "my-agent",
description: 'An agent with domain knowledge\n\n',
plugins: [
createSkillsPlugin({ paths: ["./skills"] }),
createBashPlugin(),
],
}],
);Skills load domain knowledge on-demand, while bash plugin enables script
execution. For scripts in scripts/ directory, skills returns the path - use
bash tool to execute.
Complete Examples: See 14-skills-plugin.ts and 25-skills-with-bash.ts.
For agents with detailed instructions, use the manual field to reduce initial
prompt length - the full manual is fetched on-demand via man { manual: true }:
…Complete Example: See 21-progressive-manual.ts.
Three simple steps:
mcpc() to build and connect your serverMCPC provides multiple flexible execution modes to fit different scenarios:
| Mode | Description | Use Case | Requires Plugin |
|---|---|---|---|
agentic |
Interactive step-by-step execution | Standard agent interactions | Built-in |
ai_sampling |
AI SDK sampling mode | Autonomous AI SDK execution | Built-in |
ai_acp |
AI SDK ACP mode | Coding agents (Claude Code, etc.) | Built-in |
code_execution |
Secure JavaScript sandbox with tool access | Code generation and execution | External |
code_execution_sampling |
Secure sandbox plus MCP sampling-backed calls | Sandbox execution that can also ask the client model | External |
Note:
agentic,ai_sampling, andai_acpare built-in modes — just setoptions.modeand they work.code_executionandcode_execution_samplingrequire installing and loading their respective plugin packages.
// Interactive agent (default)
{ options: { mode: "agentic" } }
// Autonomous agent
{ options: { mode: "ai_sampling", samplingConfig: { maxIterations: 10 } } }
// Code execution with sandbox
import { createCodeExecutionPlugin } from "@mcpc/plugin-code-execution/plugin";
{
plugins: [createCodeExecutionPlugin()],
options: { mode: "code_execution" }
}Detailed Documentation: See Execution Modes Guide for comprehensive information on each mode, configuration options, and best practices.
See working examples in the examples directory or check out the Codex fork tutorial.
We welcome contributions! See CONTRIBUTING.md for details.
MIT License - see LICENSE for details.
暂无开放 Issues,或尚未同步最近议题。