Skip to main content

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

  1. Define Functions: Create mcp.functions.ts with your MCP functions
  2. Register Endpoints: Create mcp.routes.ts to register your functions
  3. Start Server: Run npx pikku serve mcp

Function Types

  • pikkuMCPToolFunc<T> - Create tools that perform actions
  • pikkuMCPResourceFunc<T> - Create resources that provide data
  • pikkuMCPPromptFunc<T> - Create prompt templates

Registration Functions

  • addMCPTool() - Register a tool endpoint
  • addMCPResource() - Register a resource endpoint
  • addMCPPrompt() - Register a prompt endpoint