> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP examples

> Connect to an MCP server and use its tools like local defineTool tools.

# MCP examples

Runnable files: [agentium-examples/toolkits](https://github.com/agentiumOS/agentium-examples/tree/main/toolkits) (`16-mcp-tools.ts`, `mcp-local-http.ts`).

Guide: [MCP](/mcp/overview)

```bash theme={null}
npm install @modelcontextprotocol/sdk
```

***

## 1. GitHub MCP over stdio

```typescript theme={null}
import { Agent, openai, MCPToolProvider } from "@agentium/core";

const githubMcp = new MCPToolProvider({
  name: "github",
  transport: "stdio",
  command: "npx",
  args: ["-y", "@modelcontextprotocol/server-github"],
  env: { GITHUB_TOKEN: process.env.GITHUB_TOKEN ?? "" },
});

await githubMcp.connect();

const mcpTools = await githubMcp.getTools({
  include: ["list_releases", "search_repositories"],
});

const agent = new Agent({
  name: "github-bot",
  model: openai("gpt-4o"),
  instructions: "You use GitHub tools. Prefer the filtered list.",
  tools: mcpTools,
});

await agent.run("What is the latest release of agentiumOS/agentium?");
```

Filter with `include` so you do not dump every MCP tool into the prompt.
