MCP (Model Control Protocol)
The Model Control Protocol (MCP) integration allows you to expose your Pikku functions as tools and resources that AI models can interact with directly.
info
The MCP integration is still experimental. We support the basics (prompts, tools and resources) but haven't yet exposed or implemented the entire protocol.
Getting Started​
- Introduction - Overview and quick start guide
- Tools - Create functions that AI models can call
- Resources - Expose data sources for AI models to read
- Prompts - Generate structured conversation templates
Quick Reference​
Basic Setup​
- Define Functions: Create
mcp.functions.ts
with your MCP functions - Register Endpoints: Create
mcp.routes.ts
to register your functions - Start Server: Run
npx pikku serve mcp
Function Types​
pikkuMCPToolFunc<T>
- Create tools that perform actionspikkuMCPResourceFunc<T>
- Create resources that provide datapikkuMCPPromptFunc<T>
- Create prompt templates
Registration Functions​
wireMCPTool()
- Register a tool endpointwireMCPResource()
- Register a resource endpointwireMCPrompt()
- Register a prompt endpoint