agentleFS
mcpc-techmcpc-tech/mcpc/.github/copilot-instructions.md

mcpc

Copilot instructions103 starsChanged 7 months agoMITView on GitHub

MCPC lets you build agentic MCP servers by composing existing MCP tools. Think of it as creating AI agents from reusable tool libraries, the agent itself is a MCP tool too. NEVER use deno specific APIs in code, use node compatible APIs only. Every MCPC server follows the same simple pattern: That's it. Three parts: server metadata, agent definition(s), transport connection. Reference tools in your agent description using XML-like syntax: Tool names are always servername.toolname. The framework auto-maps both server.tool…

  • Reads credentials

The file

We split this copilot-instructions.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    NEVER use deno specific APIs in code, use node compatible APIs only.

    line 9
  2. Very specific:

    Every MCPC server follows the same simple pattern:

    line 13
  3. Very specific:

    Environment variables in configs: Use ${VAR_NAME} syntax in JSON strings - parsed at runtime.

    line 156

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

MCPC Development Guide

MCPC lets you build agentic MCP servers by composing existing MCP tools. Think of it as creating AI agents from reusable tool libraries, the agent itself is a MCP tool too.

Rules

NEVER use deno specific APIs in code, use node compatible APIs only.

Core Pattern

Every MCPC server follows the same simple pattern:

const server = await mcpc(
  [{ name: "my-agent", version: "1.0.0" }, {
    capabilities: { tools: {} },
  }],
  [{
    name: "my-agent",
    description: "Agent docs with <tool name='server.tool'/> references",
    deps: { mcpServers: {/* MCP server configs */} },
    options: { mode: "agentic" },
  }],
);
await server.connect(new StdioServerTransport());

That's it. Three parts: server metadata, agent definition(s), transport connection.

Tool Selection with XML Tags

Reference tools in your agent description using XML-like syntax:

description: `
Available tools:
<tool name="desktop-commander.read_file"/>
<tool name="github.__ALL__"/>  // All tools from github server
<tool name="tool1" maxResultLength="2000"/>  // Limit result size
<tool name="sensitive" hide/>  // Hide from public interface
`;

Tool names are always servername.toolname. The framework auto-maps both server.tool and server_tool formats.

MCP Server Dependencies

Support all transport types: stdio, streamable-http, sse.

deps: {
  mcpServers: {
    "desktop-commander": {
      command: "npx",
      args: ["-y", "@wonderwhy-er/desktop-commander@latest"],
      transportType: "stdio"
    },
    "github": {
      transportType: "streamable-http",
      url: "https://api.githubcopilot.com/mcp/",
      headers: { "Authorization": "Bearer ${GITHUB_TOKEN}" }  // Env vars work
    }
  }
}

Execution Modes

  • mode: "agentic" (default): Interactive tool calls, agent decides next step
  • mode: "agentic_workflow": Structured steps (predefined or generated at runtime)
  • sampling: true: Autonomous execution in compatible clients (VS Code, etc.)

Sampling requires capabilities.sampling: {} in client.

Plugin System

Load plugins globally or inline:

{
  plugins: [
    "./plugins/large-result.ts?maxSize=8000", // File path with query params
    { name: "inline-plugin", transformTool: (tool) => {/* modify tool */} },
  ];
}

Plugins follow lifecycle: configureServer → composeStart → transformTool → finalizeComposition → composeEnd.

See packages/core/src/plugin-types.ts for full plugin interface.

Project Structure

  • packages/core/ - Main framework (mod.ts is entry point)
  • packages/cli/ - HTTP server wrapper with config file support
  • packages/core/src/compose.ts - ComposableMCPServer class, core composition
  • packages/core/src/executors/ - Three mode implementations
  • packages/core/examples/ - Working examples (best learning resource)

Development Workflow

# Enable git hooks for auto-formatting/linting
git config core.hooksPath .githooks

# Run precommit checks manually
deno task precommit  # Runs: lint, check, fmt

# Run examples (great for testing)
deno run --allow-all packages/core/examples/01-basic-composition.ts

# Test
deno test --allow-env --allow-read packages/core/tests/

# Install dependencies (workspace uses Deno with npm compatibility)
deno install

CLI Usage

The CLI wraps core with HTTP/SSE support and config files:

# From inline JSON
deno run --allow-all packages/cli/src/bin.ts --config '{"name":"agent",...}'

# From URL
deno run --allow-all packages/cli/src/bin.ts --config-url https://example.com/config.json

# From file (or defaults to ./mcpc.config.json)
deno run --allow-all packages/cli/src/bin.ts --config-file ./codex-fork.json

Config structure matches ComposeDefinition - see packages/cli/examples/configs/ for examples.

Common Patterns

Internal tools (hidden from LLM, accessible via callTool()):

server.tool("internal-audit", "...", schema, callback, { internal: true });

Large result handling: Results >8KB auto-truncate with grep-search tool suggestion. Original stored in toolResultStorage singleton.

Environment variables in configs: Use ${VAR_NAME} syntax in JSON strings - parsed at runtime.

Design Philosophy

KISS principle throughout:

  • Declarative over imperative
  • Single-purpose agents with explicit tool selection
  • Simple mcpc() API, not complex builders
  • Examples over extensive documentation

Quick Troubleshooting

  • Tool not found? Use full name: server.tool (not just tool)
  • __ALL__ includes every tool from a server - use sparingly
  • Config not loading? CLI checks: --config → --config-url → --config-file → ./mcpc.config.json

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.