connect-tools-and-mcp
БесплатноБез исполняемых скриптовНе проверенGiving crewAI agents tools and MCP servers on crewai 1.15.x: custom BaseTool with args_schema and @tool, which crewai_tools names really exist, tool caching…
от crewAIInc★ 51 звезда на GitHubОб этом скилле
Connect Tools and MCP Servers to CrewAI Agents
Give an agent working tools - custom Python, prebuilt crewai_tools, or MCP servers - without the 0.x-era mistakes that fail silently.
Verified against crewai 1.15.22 and 1.15.23 on 2026-10-01.
Live-tested on CrewAI AMP and real LLMs on 2026-10-01.
Run crewai version first; if the major/minor differs from 1.15, re-verify version-sensitive rows with the ask-docs skill before trusting them.
1. Pick the mechanism
| You need | Use | Section |
|---|---|---|
| A quick Python function as a tool | @tool from crewai.tools |
3 |
| A tool with config, state, or a documented input schema | BaseTool subclass with args_schema |
3 |
| A prebuilt search/scrape/file tool | crewai_tools - but import it once to prove the name exists |
5 |
| A remote MCP server | Agent(mcps=[MCPServerHTTP(...)]) - not an https:// string if the crew is deployed or uses akickoff() |
6, 8 |
| An MCP server that ships with your code | Agent(mcps=[MCPServerStdio(...)]) - also works on CrewAI AMP when the server is in the package |
6, 10 |
| An integration connected in your CrewAI AMP account | mcps=["<slug>"] or "<slug>#<tool>" |
6 |
| Bare MCP tool names or a manual start/stop lifecycle | MCPServerAdapter (needs crewai-tools[mcp]) |
9 |
mcp is already a core dependency of crewai 1.15.x - native mcps= needs no extra install.
2. Imports
| You probably wrote | Current form | What happens with the old form |
|---|---|---|
from crewai_tools import BaseTool |
from crewai.tools import BaseTool |
ImportError: cannot import name 'BaseTool' from 'crewai_tools' |
from crewai_tools import tool |
from crewai.tools import tool |
ImportError: cannot import name 'tool' from 'crewai_tools' |
from crewai_tools import CodeInterpreterTool |
a sandbox tool: E2BPythonTool, DaytonaPythonTool |
ImportError - removed |
from crewai_tools import ZapierActionsAdapter |
from crewai_tools.adapters.zapier_adapter import ZapierActionsAdapter (or top-level ZapierActionTools) |
ImportError at top level |
from crewai.mcp import ... for the adapter |
from crewai_tools import MCPServerAdapter |
adapter lives in crewai_tools; native configs live in crewai.mcp |
from crewai.tools import BaseTool, tool, ToolFailure, ToolExecutionFailedError
from crewai.mcp import (
MCPServerStdio, MCPServerHTTP, MCPServerSSE,
create_static_tool_filter, create_dynamic_tool_filter,
)
from crewai.mcp.exceptions import MCPConnectionError
3. Custom tools
from pydantic import BaseModel, Field
from crewai.tools import BaseTool, tool
class PriceInput(BaseModel):
sku: str = Field(..., description="Product SKU, e.g. 'A-100'")
currency: str = Field("EUR", description="ISO currency code")
class PriceTool(BaseTool):
name: str = "price_lookup"
description: str = "Return the unit price for a SKU. Use before quoting a price."
args_schema: type[BaseModel] = PriceInput
def _run(self, sku: str, currency: str = "EUR") -> str:
return f"{sku} costs 9.99 {currency}"
@tool("Unit Converter")
def convert(km: float) -> str:
"""Convert kilometres to miles."""
return f"{km * 0.621371:.1f} mi"
print(PriceTool().run(sku="A-100")) # args are validated against PriceInput first
print(convert.run(km=10))
Rules that prevent real failures:
| Rule | Failure it prevents |
|---|---|
Always define _run, even for an async tool |
_run is abstract: TypeError: Can't instantiate abstract class ... without an implementation for abstract method '_run' |
Put async code in async def _run(...) |
Agents execute tools through _run in both kickoff() and akickoff(); an _arun override is only used when you call tool.arun() yourself |
Give @tool functions a docstring |
ValueError: Function must have a docstring at decoration time |
| Write the description for the LLM: what it does and when to use it | The agent picks tools by description; MCP tools in particular have opaque names (section 7) |
| Expect the displayed name to be sanitized | @tool("Unit Converter") is offered to the LLM as unit_converter (seen in a live run with claude-haiku-4-5) |
Return a ToolFailure instead of an error string |
An error string looks like data; a ToolFailure is recorded in TaskOutput.tool_failures and can abort the run (below) |
Per-tool options (all on BaseTool and accepted by @tool(...) where noted):
| Field | Effect (verified) |
|---|---|
max_usage_count=N (also @tool("x", max_usage_count=N)) |
After N runs within one task the agent gets Tool '...' has reached its usage limit of N times and cannot be used anymore. The next task or kickoff gets a fresh allowance, so enforce "once per run" side effects yourself. 0 or negative is a ValidationError |
result_as_answer=True (also on @tool) |
The tool's return value becomes the task output; no further LLM call |
| `cache_fu |
Установить connect-tools-and-mcp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл connect-tools-and-mcp?
Giving crewAI agents tools and MCP servers on crewai 1.15.x: custom BaseTool with args_schema and @tool, which crewai_tools names really exist, tool caching, max_usage_count, ToolFailure, Agent(mcps=[...]) string and MCPServerStdio/HTTP/SSE forms, rewritten MCP tool names, MCPServerAdapter, timeouts, and what works on a hosted deployment. Use when writing or debugging a tool or MCP connection, when you see 'cannot import name BaseTool from crewai_tools', 'You are missing the mcp package', 'MCPConnectionError', 'Operation timed out after 30 seconds', 'reached its usage limit', 'Invalid MCP reference', 'Anthropic function name ... must start with a letter', an agent that never calls an MCP tool, mcps=[...] that yields no tools (for example an https:// string under akickoff or on CrewAI AMP), or a stdio MCP server that works locally but not after deploy.
Как установить скилл connect-tools-and-mcp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл connect-tools-and-mcp запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic