mokei
TypeScript toolkit for creating, interacting and monitoring clients and servers using the Model Context Protocol
Documentation
Mokei
TypeScript toolkit for creating, interacting with, and monitoring clients and servers using the Model Context Protocol (MCP).
Features
- MCP Server & Client - Full protocol implementation
- Protocol Revisions - Serves and speaks both `2025-11-25` and `2026-07-28`, selected per context or negotiated automatically
- Multi-Context Host - Manage multiple MCP servers with tool namespacing
- Session Management - High-level chat abstraction with tool calling
- Agent Loop - Automatic tool execution with configurable approval
- Model Providers - OpenAI, Anthropic, Ollama, and local GGUF (llama.cpp) integration
- Monitoring - Real-time observation of MCP traffic
- CLI - Interactive chat and server inspection tools
Quick Start
pnpm add @mokei/session @mokei/openai-providerimport { Session } from '@mokei/session'
import { OpenAIProvider } from '@mokei/openai-provider'
const session = new Session({
providers: {
openai: OpenAIProvider.fromConfig({
apiKey: process.env.OPENAI_API_KEY
})
}
})
// Add an MCP server
await session.addContext({
key: 'myserver',
command: 'node',
args: ['my-mcp-server.js']
})
// Chat with tool access
const response = await session.chat({
provider: 'openai',
model: 'gpt-4',
messages: [{ source: 'client', role: 'user', text: 'Hello!' }]
})Documentation
- **Full Documentation** - Complete guides and API reference
- **Quick Start Guide** - Get running in minutes
- **docs/** - Local documentation
Packages
| Package | Description |
|---|---|
| `@mokei/context-server` | MCP server implementation |
| `@mokei/context-client` | MCP client implementation |
| `@mokei/host` | Multi-context orchestrator |
| `@mokei/session` | High-level session management |
| `@mokei/openai-provider` | OpenAI integration |
| `@mokei/anthropic-provider` | Anthropic Claude integration |
| `@mokei/ollama-provider` | Ollama integration |
| `@mokei/llama-provider` | Local GGUF inference via node-llama-cpp |
| `@mokei/http-client` | MCP Streamable HTTP client transport |
| `@mokei/http-server` | MCP Streamable HTTP server transport |
| `mokei` | CLI tool |
CLI
mokei monitor # Start the monitor UI for MCP server traffic
mokei inspect # Inspect an MCP server (prints how it describes itself)
mokei chat -p openai # Interactive chat
mokei proxy # Proxy an MCP server through the daemonContributing
See AGENTS.md for development setup and code style guidelines.
License
MIT
Frequently asked questions
What is mokei?
mokei is TypeScript toolkit for creating, interacting and monitoring clients and servers using the Model Context Protocol
How do I install mokei?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mokei open source?
Yes — it is hosted on GitHub at https://github.com/TairuFramework/mokei.
Related MCP tools
Composio equips your AI agents & LLMs with 100+ high-quality integrations via function calling for the Model Context Protocol. Enhance AI assistants with powerf
📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Lan...
The TypeScript AI agent framework. ⚡ Assistants, RAG, observability. Supports any LLM: GPT-4, Claude, Gemini, Llama. Built for the Model Context Protocol to enh
Rich-text editor with AI, MCP, and shadcn/ui TypeScript-based implementation. Trusted by 15300+ developers. Trusted by 15300+ developers.
MCP server to provide Figma layout information to AI coding agents like Cursor TypeScript-based implementation. Trusted by 11600+ developers.
Mcp-use is the easiest way to interact with mcp servers with custom agents TypeScript-based implementation. Trusted by 8100+ developers.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP