Registry / ai-ml / llama-index-tools-mcp

llama-index-tools-mcp

JSON →
library0.4.8pypypiunverified

This package provides integration between LlamaIndex and the Model Context Protocol (MCP), enabling LLMs to call external tools defined via MCP servers. Version 0.4.8 requires Python >=3.10, <4.0. Releases are frequent, matching LlamaIndex's cadence.

pip install llama-index-tools-mcp
INSTALL
IMPORT
SIG · LLAMA-INDEX-TOOLS-
L
llama-index-tools-mcp
ai-mlpythonv0.4.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MCPToolSpec
from llama_index.tools.mcp import MCPToolSpec
from llama_index.tools.mcp import MCPToolSpec

Connects to an MCP server and lists available tools.

import asyncio from llama_index.tools.mcp import MCPToolSpec, MCPServerConfig async def main(): config = MCPServerConfig( command="python", args=["-m", "mcp_server_example"], env={} ) tool_spec = await MCPToolSpec.from_server(config) tools = await tool_spec.to_tool_list() for tool in tools: print(tool.metadata.name) asyncio.run(main())
Debug
Known issues
breakingMCPToolSpec.from_server() is async and must be awaited. Calling it without await will raise a coroutine warning or TypeError.
fix
Use `await MCPToolSpec.from_server(config)`
affects: all
gotchaMCPServerConfig requires a command and args; missing these will cause a runtime error when starting the subprocess.
fix
Always provide both 'command' and 'args' parameters to MCPServerConfig.
affects: all
deprecatedOlder versions used `from llama_index.tools_mcp import MCPToolSpec`. This import path no longer works.
fix
Use `from llama_index.tools.mcp import MCPToolSpec`
affects: <0.4.0
Upgrade
Version history
0.4.8latest on PyPI · released Feb 24, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

llama-index-tools-mcp — pip install llama-index-tools-mcp · libregistry