Matimo Documentation
Matimo β Enable AI Agents To Build Themselves
Open-source tool governance for AI agents: every call risk-checked, every risky one approved by a human, every result on a log you can verify
Give your agents 129 production-ready tools to start (plus a governed 449-tool Composio catalog). Then activate 15 meta-tools that let them create, validate, and approve new capabilities at runtime β governed by your policy engine with human approval workflows for critical actions.
Self-extending agents with enterprise-grade control:
- π§ Meta-Tools β Agents write new tool definitions in YAML, validate schemas, approve for production, and hot-reload β all mid-conversation
- π‘οΈ Policy Engine β Classify every action by risk level, block dangerous operations, quarantine draft tools
- π€ Human-in-the-Loop (HITL) β Critical tools require human approval before execution with configurable timeouts and audit trails
- π Universal Integration β One YAML definition works across TypeScript, Python, LangChain, CrewAI, Claude MCP, OpenAI
New here? Read Why Matimo OSS and what changed in 0.2.0.
Complete documentation for Matimo 0.3.0 (TypeScript @matimo/core 0.3.0 and Python matimo 0.2.0).
New in 0.3.0: Node 22.19+ is now required, and the open security advisories are patched. See the release notes.
Since 0.2.0 β secure by default. HTTP DELETE and command tools ask a human before every call, each instance has its own approval callback (
onApproval), MCP servers ask the clientβs user through elicitation, every call emits events you can keep in a tamper-evident audit log, and both SDKs enforce the same rules. Upgrading? Read the migration guide.
π Choose Your SDK
π¦ TypeScript / Node.js
- Node.js 22.19+, npm/pnpm
- ESM, full type support
- Enforced coverage floors (95% lines)
- Start with TypeScript
π Python π Stable Release
- Python 3.11+, pip/uv
- Native asyncio, full type hints (mypy strict)
- LangChain, CrewAI, MCP support
- Start with Python
β‘ Getting Started
TypeScript Getting Started
- Quick Start β 5-minute setup
- Your First Tool β Create a basic YAML tool
- API Reference β SDK fundamentals
Python Getting Started
- Quick Start β 5-minute setup with
pip install matimo - LangChain Integration β Build ReAct agents
- CrewAI Integration β Multi-agent orchestration
- Agno Integration β Governed Agno agents, teams and workflows
- API Reference β Python SDK documentation
π¦ Installation & Requirements
- Installation β Detailed setup for both SDKs
- TypeScript (Node.js 22.19+) and Python (3.11+) requirements
- From npm/pip (recommended) or from source
- Troubleshooting & environment setup
- Provider authentication via OAuth2
π Reference (By Topic)
π’ Core Concepts (Start Here)
- Architecture Overview β Understand how Matimo works
- High-level system design
- Three integration patterns (Factory, Decorator, Framework)
- Framework compatibility (LangChain, CrewAI, MCP, custom)
- Data flow and execution model
- SDK Patterns β TypeScript & Python examples
- Factory pattern (simplest)
- Decorator pattern (class-based)
- Framework integration patterns
- API Reference β Complete SDK reference
- TypeScript
MatimoInstanceAPI - Python
MatimoAPI .execute(),.listTools(),.searchTools()- Error handling & logging
- Complete type definitions
- TypeScript
- Error Reference β Troubleshooting guide
- Error codes and meanings
- Common scenarios
- Debugging techniques
- Recovery patterns
π‘ Tool Development
- Tool Specification β Write tools in YAML
- Tool metadata and parameters
- Execution types (
http,function,command) - Authentication and credential placeholders
- Risk,
requires_approvaland status fields - Real definitions from the provider packages
-
Tool Workflow β Checklist for adding a tool to both SDKs
-
Decorator Guide β
@toolmethods backed by YAML tools - Adding Tools to Matimo β Publish @matimo/* packages
- 6-step guide for creating providers
- Auto-discovery mechanism
- Publishing to npm
- GitHub provider real example
- CLI tool management
- Testing Tools β Unit & integration testing
- Testing patterns with Jest / pytest
- Mocking external services
- TypeScript coverage floors (lines 95%, functions 97%, branches 87%)
- Test fixtures
- OAuth Setup β OAuth2 authentication
- OAuth2 flow implementation
- Provider-specific configurations
- Token management
- Security best practices
π‘οΈ Policy & Lifecycle (Security)
- Policy Engine & Tool Lifecycle β Complete security guide
- PolicyConfig setup and immutability
- Content Validator (9 security rules)
- Risk classification levels
- Tool lifecycle: create β approve β reload β use
- Approval system (interactive, auto-approve, MCP)
- Integrity tracking (SHA-256, HMAC)
- RBAC & access control
- Audit events
- Meta-Tools Reference β Built-in tool management tools
matimo_search_tools/matimo_get_tool/matimo_get_tool_statusβ Find tools and inspect their definition and statusmatimo_validate_toolβ Validate YAML against schema + policymatimo_create_toolβ Create tools with safety enforcementmatimo_approve_toolβ Promote draft tools with HMAC signingmatimo_reload_toolsβ Hot-reload the live registrymatimo_list_user_toolsβ Discover tools with metadatamatimo_create_skillβ Create SKILL.md filesmatimo_list_skillsβ List skills in a directorymatimo_get_skillβ Read a skillβs content by namematimo_validate_skillβ Validate a skill against the Agent Skills specmatimo_search_skillsβ Semantically rank skills by relevance (TF-IDF)matimo_get_skill_sectionsβ Inventory a skillβs sections and token costsmatimo_get_skill_contentβ Load only specific sections of a skill
- Approval System β Approval handler configuration
- Per-instance
onApprovalcallbacks - Pre-approved patterns and environment variables
- MCP elicitation
- Per-instance
-
Logging β Logger configuration and formats
-
MCP Server β Serve Matimo tools to Claude Desktop, Cursor and other MCP clients (setup guides)
- Composio β The governed Composio catalog (
@matimo/composio)
π΄ Advanced Topics
- OAuth Architecture β Deep dive into OAuth2
- Protocol flow details
- Provider integrations
- Token lifecycle
- Security considerations
- Provider Configuration β Multi-provider setup
- Managing multiple providers
- Configuration patterns
- Environment variables
- Provider-specific settings
- Type Definitions β Complete TypeScript types
- Full interface reference
- Parameter and execution types
- Response validation types
-
Framework Integrations β LangChain (TS + Python), CrewAI, Agno, Vercel AI SDK, Bruno
-
Skills β SKILL.md knowledge documents and TF-IDF search
- Notebooks β Colab notebooks: quickstart, policy engine, meta-tools, skills, MCP server
Project Information
- Release Notes β New features, bug fixes, and breaking changes
- Roadmap β Upcoming features and long-term vision
π₯ For Contributors
Want to contribute? Start here:
- Contributing Guidelines β Full contribution workflow
- Setup and development environment
- Code standards and best practices
- TDD (Test-Driven Development) approach
- Commit message format
- PR checklist
- Commit Guidelines β Conventional commits standard
- Type, scope, subject format
- Examples for feat, fix, docs, etc.
- Git workflow tips
- Development Standards β Code quality requirements
- TypeScript strictness
- Testing coverage (TypeScript floors enforced; Python informational)
- ESLint / ruff and Prettier
- JSDoc documentation
Development & Advanced Usage
- SDK Patterns β SDK usage patterns and best practices
- Factory pattern usage
- Decorator pattern examples
- LangChain integration patterns
- Error handling strategies
- Performance optimization
- Tool Discovery β Finding and using tools
- Auto-discovery from npm packages
- Tool search and filtering
- Registry management
- Loading from directories
- Authentication β API keys, OAuth2, and token management
- API key setup
- OAuth2 flows
- Token refresh and storage
- Provider-specific auth patterns
- Security best practices
Troubleshooting
- FAQ & Common Issues β Answers to common questions
- Setup problems
- Tool execution issues
- Authentication errors
- Performance tips
Quick Navigation by Role
π Just Getting Started (First 30 minutes)
- Quick Start β Install and run your first tool
- Your First Tool β Create a basic YAML tool
- API Reference β Understand the SDK basics
- If stuck β FAQ
π οΈ Building Tools
- Tool Specification β YAML schema reference
- Adding Tools to Matimo β Publish a package
- Testing Tools β Write tests
- OAuth Setup β Add authentication
π€ Integrating with Frameworks (LangChain, CrewAI, etc.)
- Architecture Overview β Understand patterns
- Framework Integrations β Integration examples
- SDK Patterns β Best practices
π Securing Agent Tool Usage
- Policy & Lifecycle Guide β Full security setup
- Meta-Tools Reference β Built-in management tools
- Approval System β Approval handler config
- Policy Demo (Python) β 11-mission autonomous agent demo
- Policy Demo (TypeScript) β TypeScript equivalent
- Skills Demo (Python) β 6-mission skills lifecycle demo
π€ For AI Agents (Quick Orientation)
If you are an AI agent (LangChain, CrewAI, MCP client) reading this to understand Matimo:
- Read first: Meta-Tools Reference β the 15 built-in meta-tools you can call right now
- Tool creation flow:
matimo_validate_toolβmatimo_create_toolβmatimo_approve_toolβmatimo_reload_tools - Skills discovery:
matimo_list_skillsβmatimo_get_skillto load domain expertise on-demand - OpenAI 128-tool limit: If using
auto_discover=True, cap your bound tool list β prioritizematimo_*tools first - Policy rules: Draft tools are blocked whenever the context
environmentstring contains βprodβ (case-insensitive substring match β"prod","production","PRODUCTION-us-east"all match), and in any other environment they run only for a caller with theadminrole; approve a tool withmatimo_approve_toolto use it normally. Command tools, HTTP DELETE tools and tools withrequires_approval: trueask a human before every call. SSRF-blocked URL patterns are rejected by the content validator both at creation/approval time and again at execution time against the fully-resolved URL. - Errors: All errors are
MatimoErrorwith typedErrorCode. Checkerror.codefor programmatic handling. - Examples to study:
python/examples/native/meta_flow/meta_tools_integration.pyis the canonical end-to-end reference.
π¨βπ» Contributing Code
- Start here: Contributing Guidelines
- Clone repo and set up locally
- Commit Guidelines β Proper commit format
- Development Standards β Code quality rules
- Open PR and request review
π Maintaining/Reviewing
- Development Standards β Review checklist
- Contributing Guidelines β PR requirements
- Commit Guidelines β Validate commits
- Architecture Overview β Understand design decisions
Documentation Structure
docs/
βββ index.md # This file β documentation index
βββ RELEASES.md # Release notes and changelog
βββ ROADMAP.md # Project roadmap
βββ MCP.md # MCP server setup and Claude Desktop
βββ COMPOSIO.md # Governed Composio catalog
βββ mcp/ # MCP setup, quick reference, maintenance
βββ notebooks/ # Colab notebooks (00_index β¦ 05_mcp_server)
βββ getting-started/
β βββ QUICK_START.md # 5-minute setup (TypeScript + Python)
β βββ installation.md # Detailed installation
β βββ YOUR_FIRST_TOOL.md # Create your first tool
βββ api-reference/
β βββ SDK.md # Complete SDK API (TypeScript + Python)
β βββ ERRORS.md # Error handling and error codes
β βββ TYPES.md # TypeScript type definitions
β βββ META_TOOLS.md # Built-in meta-tools reference (15 tools)
β βββ POLICY_AND_LIFECYCLE.md # Policy engine and tool lifecycle
β βββ APPROVAL-SYSTEM.md # Approval handler configuration
β βββ LOGGING.md # Logger API and formats
βββ tool-development/
β βββ TOOL_SPECIFICATION.md # YAML tool schema reference
β βββ YAML_TOOLS.md # YAML tool writing guide
β βββ ADDING_TOOLS.md # Creating tool provider packages
β βββ DECORATOR_GUIDE.md # TypeScript decorators
β βββ TESTING.md # Testing tools
β βββ TOOL_WORKFLOW.md # Step-by-step tool checklist
β βββ HTTP_PARAMETER_EMBEDDING.md # HTTP parameter encoding
β βββ PROVIDER_CONFIGURATION.md # Multi-provider setup
βββ framework-integrations/
β βββ LANGCHAIN.md # LangChain (Python + TypeScript)
β βββ CREWAI.md # CrewAI multi-agent (Python)
β βββ AGNO.md # Agno agents/teams/workflows (Python)
β βββ BRUNO.md # Bruno API testing
β βββ VERCEL_AI.md # Vercel AI SDK (TypeScript)
βββ skills/
β βββ SKILLS.md # Skills system guide
β βββ TFIDF_SEMANTIC_SEARCH.md # TF-IDF implementation details
βββ architecture/
β βββ OVERVIEW.md # System design and patterns
β βββ OAUTH.md # OAuth2 implementation
βββ user-guide/
β βββ SDK_PATTERNS.md # Factory, decorator, framework patterns
β βββ TOOL_DISCOVERY.md # Auto-discovery and search
β βββ AUTHENTICATION.md # API keys, OAuth2, token management
β βββ DEVELOPMENT_STANDARDS.md # Code quality rules
βββ community/
β βββ COMMIT_GUIDELINES.md # Conventional commits
βββ troubleshooting/
βββ FAQ.md # Common questions & solutions
Python examples (python/examples/):
βββ native/ # Factory, decorator + advanced agent demos
β βββ policy/policy_demo.py # 11-mission policy + HITL lifecycle
β βββ skills/skills_demo.py # 6-mission skills lifecycle
β βββ meta_flow/meta_tools_integration.py # 5-mission meta-tools lifecycle
β βββ logger_example.py # Logging demo (no API key needed)
βββ langchain/ # LangChain agents, per provider
βββ crewai/ # CrewAI agents, per provider
βββ agno/ # Agno agents
βββ bruno/ # Bruno collections as governed tools
βββ mcp/ # MCP server and client (own uv project)
TypeScript examples (typescript/examples/tools/):
βββ <provider>/ # factory, decorator, langchain, with-approval per provider
βββ policy/policy-demo.ts # 11-mission policy lifecycle
βββ skills/skills-demo.ts # Skills lifecycle + TF-IDF
βββ meta-flow/meta-tools-integration.ts # Meta-tools lifecycle
βββ agents/langchain-skills-policy-agent.ts # Production agent pattern
Key Concepts
Tools
Tools are the building blocks of Matimo. They define what can be executed, what parameters they accept, and how they run.
- YAML Tools β Declarative tool definitions (see Tool Specification)
- Decorators β
@tool('name')class methods that call a loaded YAML tool (see Decorator Guide)
Executors
Executors run tools with different backends:
- HttpExecutor β
type: http, REST calls (the default) - FunctionExecutor β
type: function, a co-located.ts/.jsor.pyfile - CommandExecutor β
type: command, shell CLIs (asks for approval on every call)
See API Reference for details.
SDK
Load tools and execute them:
import { MatimoInstance } from '@matimo/core';
const matimo = await MatimoInstance.init({ autoDiscover: true });
const result = await matimo.execute('calculator', { operation: 'add', a: 2, b: 3 });
from matimo import Matimo
matimo = await Matimo.init(auto_discover=True)
result = await matimo.execute("calculator", {"operation": "add", "a": 2, "b": 3})
See Quick Start and API Reference.
MCP Server
Matimo can run as an MCP server, allowing Claude and other clients to discover and use tools:
npx matimo mcp # stdio, for Claude Desktop / Cursor
import { createMCPServer } from '@matimo/core/mcp';
const server = await createMCPServer({ transport: 'http', port: 3000, autoDiscover: true });
See MCP.md for client configuration, HTTP mode and Python.
Standards & Practices
Code Quality
- TypeScript: Strict mode enforced (no
any) - Testing: TypeScript coverage floors enforced (lines 95%, functions 97%, branches 87%, statements 95%); Python coverage is reported, not enforced
- Linting: ESLint with automatic formatting
- Documentation: JSDoc comments for all public APIs
Commits
- Format: Conventional Commits (type(scope): subject)
- Types: feat, fix, docs, refactor, test, chore, perf, style, ci, revert, example
- Examples: βfeat(executor): add HTTP supportβ, βfix(schema): validate enumsβ
See Commit Guidelines.
Pull Requests
- Follow TDD approach (test first, implement after)
- Keep PRs focused (one feature/fix per PR)
- Ensure tests pass and the coverage floors hold
- Follow code standards and get code review
Common Tasks
Write a YAML Tool
- Create
tools/<tool-name>/definition.yaml(namematches the directory) - Follow the Tool Specification schema
- Include parameters and execution; add authentication if needed
- Run
pnpm validate-tools - Follow the Tool Workflow for tests and examples in both SDKs
Write a Decorator Tool
- Load the YAML tool with
MatimoInstance.init(...)and callsetGlobalMatimoInstance(matimo) - Add a class method decorated with
@tool('tool-name') - Calling the method executes the tool through the policy engine
- Follow Decorator Guide patterns
Integrate with LangChain
- See Framework Integrations for patterns
- Check
typescript/examples/tools/andpython/examples/langchain/for working examples - Follow Architecture Overview for design decisions
Contribute Code
- Fork and clone repository
- Create feature branch:
git checkout -b feat/description - Write tests first (TDD)
- Implement feature
- Follow Development Standards
- Commit using Commit Guidelines
- Push and create PR
- Follow Contributing Guidelines checklist
Need Help?
- Questions? Check relevant documentation or open a GitHub Discussion
- Found a bug? Open an issue
- Troubleshooting? See FAQ
- Want to contribute? See Contributing Guidelines
Documentation Note: While I strive for accuracy and completeness, this documentation may contain oversights, outdated information, or areas needing improvement, due to my limitations. If you notice any errors, missing information, or have suggestions for enhancement, please help me to improve! See our Contributing Guidelines to learn how to submit corrections and improvements. Your contributions to documentation are highly valued! Thank you.
Last updated: October 2026