Skip to main content

Provider-agnostic toolkit: dynamic MCP servers + agent skills for any LLM.

Project description

toolnexus (Python)

Provider-agnostic toolkit that gives any LLM the two dynamic capabilities opencode has:

  1. Dynamic MCP servers — read an MCP config file, connect to every server (local stdio + remote streamable-HTTP), and expose each server tool as a uniform Tool.
  2. Dynamic agent skills — read a skills folder (**/SKILL.md) and expose a single skill tool that loads a skill's instructions + resources on demand (progressive disclosure).

Built on the official MCP Python SDK (the mcp package). This is the Python sibling of the js/ reference implementation; the contract is shared (../SPEC.md).

Install

uv venv
uv pip install -e .

(Or with stdlib venv: python -m venv .venv && .venv/bin/pip install -e ..)

Quickstart

The MCP SDK is async, so the toolkit is async. Manage its lifetime with async with:

import asyncio
from toolnexus import create_toolkit


async def main():
    async with await create_toolkit(
        mcp_config="../examples/mcp.json",
        skills_dir="../examples/skills",
    ) as tk:
        print(tk.mcp_status())                       # {"everything": "connected", ...}
        print([t.name for t in tk.tools()])          # mcp tools + "skill"
        print(tk.skills_prompt())                    # ## Available Skills ...

        tools = tk.to_openai()                        # or to_anthropic() / to_gemini()

        # ... call your LLM with `tools` + skills_prompt() as system text ...
        # model returns a tool_call { name, arguments }

        res = await tk.execute(name, arguments)       # routes to the right tool
        print(res.output)                             # feed back to the model


asyncio.run(main())

create_toolkit(...) is an async factory. The returned Toolkit is also an async context manager; if you do not use async with, call await tk.close() yourself to disconnect every MCP client.

API

Python JS / SPEC equivalent
await create_toolkit(...) createToolkit(...)
tk.tools() tk.tools()
tk.get(name) tk.get(name)
await tk.execute(name, args, ctx=None) tk.execute(...)
tk.skills_prompt() tk.skillsPrompt()
tk.mcp_status() tk.mcpStatus()
tk.to_openai() / to_anthropic() / to_gemini() toOpenAI() etc.
await tk.close() tk.close()

A uniform Tool has name, description, input_schema, source ("mcp" | "skill" | "custom"), and an async execute(args, ctx=None) returning a ToolResult(output, is_error, metadata).

Examples

  • examples/basic.py — connect to the everything MCP server, list tools, print the skills catalog, and load the hello-world skill (progressive disclosure). Requires npx on PATH (for @modelcontextprotocol/server-everything).
  • examples/openrouter_test.py — a real OpenRouter tool-calling round trip. Reads OPENROUTER_API_KEY from the environment (never hardcode it).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolnexus-0.1.1.tar.gz (76.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolnexus-0.1.1-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file toolnexus-0.1.1.tar.gz.

File metadata

  • Download URL: toolnexus-0.1.1.tar.gz
  • Upload date:
  • Size: 76.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for toolnexus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f59e10a88b3099b96f37b9ae372bfbf198e59596bdff56c0847ed01ffb9a54bc
MD5 bf8ef48e8b94b00e936bd9ec200c216c
BLAKE2b-256 2662658f32b1c0ef2b8d670c7db58abfc595e00073ffc721cd525cb60bf93fe8

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolnexus-0.1.1.tar.gz:

Publisher: release.yml on muthuishere/toolnexus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file toolnexus-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: toolnexus-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for toolnexus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e86e7073d309b94fdb503004aa3bda930f9a28303ecf3b47dc3ab61d5c1ae38
MD5 ec12972c06f8a2ab1497da0673423a08
BLAKE2b-256 fe097ab26e0a2072083a93b86152e34090efe58f6eed6d0ccb8caa6bab472b9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for toolnexus-0.1.1-py3-none-any.whl:

Publisher: release.yml on muthuishere/toolnexus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page