轻量MCP工具包 是 AI Skill Hub 本期精选MCP工具之一。综合评分 7.0 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
轻量MCP工具包 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
轻量MCP工具包 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/alexeygrigorev/toyaikit
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"--mcp---": {
"command": "npx",
"args": ["-y", "toyaikit"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 轻量MCP工具包 执行以下任务... Claude: [自动调用 轻量MCP工具包 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"__mcp___": {
"command": "npx",
"args": ["-y", "toyaikit"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
ToyAIKit is a minimalistic Python library for building AI assistants powered by Large Language Models (LLMs). It provides a simple yet powerful framework for creating agentic conversational systems with advanced capabilities including function calling, tool integration, and multi-provider support.
responses and chat.completions APIs), Anthropic Claude, Z.ai, and other OpenAI-compatible providersproject_name = start_project() if project_name: project_path = Path(project_name) agent_tools = AgentTools(project_path) tools = Tools() tools.add_tools(agent_tools) developer_prompt = """ You are a coding agent. Your task is to modify the provided Django project template according to user instructions. You don't tell the user what to do; you do it yourself using the available tools. Always ensure changes are consistent with Django best practices and the project's structure. Use TailwindCSS for styling and make the results look beautiful. """ runner = OpenAIResponsesRunner( tools=tools, developer_prompt=developer_prompt, chat_interface=IPythonChatInterface(), llm_client=OpenAIClient() ) runner.run() ```
agent_tools = ... # class with some functions to be called
tools = Tools() tools.add_tools(agent_tools)
chat_interface = IPythonChatInterface()
llm_client = OpenAIChatCompletionsClient( model="gpt-4o-mini", client=OpenAI() )
zai_client = OpenAI( api_key=os.getenv('ZAI_API_KEY'), base_url='https://api.z.ai/api/paas/v4/' )
agent_tools = ...
tools = Tools() tools.add_tools(agent_tools)
runner = OpenAIChatCompletionsRunner( tools=tools, developer_prompt="You are a coding agent that can modify Django projects.", chat_interface=IPythonChatInterface(), llm_client=llm_client )
runner.run() ```
agent_tools = ... # class with some functions to be called
tools = Tools() tools.add_tools(agent_tools)
runner = AnthropicMessagesRunner( tools=tools, developer_prompt="You are a helpful assistant.", chat_interface=IPythonChatInterface(), llm_client=llm_client )
runner.run() ```
chat_interface = IPythonChatInterface() runner = OpenAIAgentsSDKRunner( chat_interface=chat_interface, agent=coding_agent )
chat_interface = IPythonChatInterface() runner = PydanticAIRunner( chat_interface=chat_interface, agent=coding_agent )
pip install toyaikit
```python from openai import OpenAI
from toyaikit.llm import OpenAIClient from toyaikit.tools import Tools from toyaikit.chat import IPythonChatInterface from toyaikit.chat.runners import OpenAIResponsesRunner
```python from toyaikit.mcp import MCPClient, SubprocessMCPTransport
llm_client = AnthropicClient( model="claude-sonnet-4-5-20250514", )
chat_interface = IPythonChatInterface() openai_client = OpenAIClient( model="gpt-4o-mini", client=OpenAI() )
The IPython-based chat interface provides an interactive way to chat with your AI assistant:
```python from toyaikit.chat import IPythonChatInterface
chat_interface = IPythonChatInterface()
The default runner uses the responses API. If you need to use the chat.completions API, use OpenAIChatCompletionsRunner:
```python from openai import OpenAI
from toyaikit.tools import Tools from toyaikit.llm import OpenAIChatCompletionsClient from toyaikit.chat.runners import OpenAIChatCompletionsRunner from toyaikit.chat import IPythonChatInterface
```python from agents import Agent, function_tool
from toyaikit.tools import wrap_instance_methods from toyaikit.chat import IPythonChatInterface from toyaikit.chat.runners import OpenAIAgentsSDKRunner
ToyAIKit includes utilities for working with MCP servers and clients:
With OpenAI:
```python from pydantic_ai import Agent
from toyaikit.tools import get_instance_methods from toyaikit.chat import IPythonChatInterface from toyaikit.chat.runners import PydanticAIRunner
Build a course teaching assistant that can search through FAQ documents and add new entries:
```python import requests from minsearch import AppendableIndex from typing import List, Dict, Any
docs_url = 'https://github.com/alexeygrigorev/llm-rag-workshop/raw/main/notebooks/documents.json' docs_response = requests.get(docs_url) documents_raw = docs_response.json()
search_tools = SearchTools(index)
tools = Tools() tools.add_tools(search_tools)
developer_prompt = """ You're a course teaching assistant. You're given a question from a course student and your task is to answer it.
If you want to look up the answer, explain why before making the call. Use as many keywords from the user question as possible when making first requests.
Make multiple searches. Try to expand your search by using new keywords based on the results you get from the search.
At the end, make a clarifying question based on what you presented and ask if there are other areas that the user wants to explore. """
runner = OpenAIResponsesRunner( tools=tools, developer_prompt=developer_prompt, chat_interface=IPythonChatInterface(), llm_client=OpenAIClient() )
runner.run() ```
ToyAIKit 是一个极简主义的 Python 库,旨在帮助开发者快速构建基于大语言模型(LLMs)的 AI 助手。它提供了一个简单且功能强大的框架,能够轻松创建具备 Agent 能力的对话系统,支持 Function Calling、工具集成以及多模型供应商接入,让构建智能体变得更加直观高效。
ToyAIKit 具备多供应商支持能力,兼容 OpenAI(包括 responses 和 chat.completions API)、Anthropic Claude 以及 Z.ai 等 OpenAI 兼容接口。它深度集成了 OpenAI Agents SDK 和 PydanticAI 框架,支持通过自动生成 Schema 实现便捷的 Function Calling。此外,它还内置了 MCP(Model Context Protocol)客户端与服务端工具,并提供基于 IPython 的交互式聊天界面,极大提升了开发体验。
您可以通过 pip 快速安装 ToyAIKit。对于需要构建 Coding Agent 的场景,建议结合项目路径与 AgentTools 进行初始化配置。安装完成后,即可通过 Python 环境直接调用相关组件,构建属于您的 AI 智能体。
安装完成后,您可以直接使用 OpenAIClient 或 AnthropicClient 来调用不同的 LLM。通过 Tools 类,您可以将自定义函数封装为工具并注入到 Agent 中。对于需要交互式体验的开发者,可以使用 IPythonChatInterface 快速搭建一个命令行对话环境,实现从模型调用到工具执行的完整闭环。
项目配置非常灵活,支持通过环境变量自动读取 ANTHROPIC_API_KEY 等敏感信息。您可以根据需求配置不同的 LLM Client,例如使用 AnthropicClient 调用 Claude 模型,或通过配置 base_url 来适配 Z.ai 等第三方 OpenAI 兼容服务。
ToyAIKit 提供了丰富的 API 接口。IPythonChatInterface 用于构建交互式对话界面;针对 OpenAI 用户,默认使用 responses API,若需使用 chat.completions API,可切换至 OpenAIChatCompletionsClient 与对应的 Runner。此外,框架还支持通过 PydanticAIRunner 实现与 PydanticAI 的无缝集成。
ToyAIKit 在工作流上实现了高度的模块化。它不仅支持 MCP(Model Context Protocol)的集成,方便开发者与 MCP 服务器进行通信,还通过 PydanticAI 提供了强大的集成能力。开发者可以利用 get_instance_methods 等工具函数,将复杂的 Python 方法直接转化为 AI 可调用的工具,实现高度自动化的 Agent 工作流。
在“Agents and MCP”工作坊示例中,您可以学习如何构建一个 FAQ 搜索 Agent。该 Agent 可以通过集成 SearchTools,在面对学生提问时,自动检索指定的文档索引并提供准确回答,实现从文档加载到智能问答的完整 RAG 工作流。
轻量级MCP实现框架,理念先进但生态成熟度有限。适合学习和小型项目,大规模应用需评估维护风险。
该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
经综合评估,轻量MCP工具包 在MCP工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | toyaikit |
| 原始描述 | 开源MCP工具:Minimalistic implementation for LLM-based chat assistants with Tool Use (functio。⭐30 · Python |
| Topics | MCP协议Python工具调用LLM集成开源框架 |
| GitHub | https://github.com/alexeygrigorev/toyaikit |
| 语言 | Python |
收录时间:2026-05-24 · 更新时间:2026-05-30 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端