MCP catalogs and agent hosts
Read complete tool contracts while keeping execution in your host.
Install an optional integration
MCP and Agents extras require Python 3.10 or newer. Base planning and text compression remain available without these SDKs.
pip install 'llmslim[mcp]==0.6.0'
# For the optional Agents SDK bridge:
pip install 'llmslim[agents]==0.6.0'List, plan, and hydrate
Configure a trusted endpoint explicitly. HTTP is allowed only for localhost development; remote endpoints require HTTPS. Stdio sources accept an executable and literal argument list. Plans default to the full catalog.
import asyncio
from llmslim.mcp import MCPToolCatalogSource, plan_catalog_context, hydrate_plan
async def main():
source = MCPToolCatalogSource.from_streamable_http(
'http://127.0.0.1:8000/mcp', source_id='local-tools'
)
snapshot = await source.list_tools()
plan = plan_catalog_context(snapshot)
schemas = hydrate_plan(snapshot, plan)
print(len(schemas), plan.metrics.catalog_tokens)
asyncio.run(main())Freshness and host ownership
The shortest page TTL governs the full snapshot. Private entries are isolated by the caller's cache principal; only explicitly public responses may be shared. Use source.refresh() or source.invalidate() when your host learns a catalog changed. Hydration rejects a plan from a different catalog fingerprint.
Questions
Does this execute MCP tools?
Catalog sources only list tools. The optional Agents bridge requires your async invocation callback; your host remains responsible for authorization, argument validation, and execution.
Does the default save schema tokens?
No. Full and measure-only plans retain every authoritative schema. Selective exposure is an explicit research-only experiment.