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.
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
addMCPTool()
- Register a tool endpointaddMCPResource()
- Register a resource endpointaddMCPPrompt()
- Register a prompt endpoint