Skip to main content

🛠️ QuantaLogic MCP Toolbox

A generic adapter for interacting with one or more MCP servers via JSON-based configuration, with automatic tool discovery, caching, and session management.


PyPI Version License: MIT


📋 Table of Contents

  1. Installation
  2. Configuration
  3. Quickstart Example
  4. Architecture
  5. API Reference
  6. Contributing
  7. License

🚀 Installation

Install from PyPI:

pip install quantalogic-toolbox-mcp

Or with Poetry:

poetry add quantalogic-toolbox-mcp

⚙️ Configuration

By default, the toolbox reads JSON files from ./mcp_config/ or the directory set by MCP_CONFIG_DIR. You can also specify a single file via the MCP_CONFIG_FILE environment variable.

Create a config file (mcp.json) in mcp_config/ with the following structure:

{
  "mcpServers": {
    "sqlite": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "mcp-test:/mcp",
        "mcp/sqlite",
        "--db-path",
        "/mcp/test.db"
      ]
    },
    "mcp_hn": {
      "command": "uvx",
      "args": ["mcp-hn"]
    },
    "fetcher": {
      "command": "npx",
      "args": ["-y", "fetcher-mcp"]
    },
    "job_search": {
      "command": "npx",
      "args": ["-y", "job-searchoor"]
    },
    "edgeone": {
      "command": "npx",
      "args": ["edgeone-pages-mcp"]
    }
  }
}
  • command: Executable or Docker alias
  • args: Argument list to launch the server

Environment variables in env entries can use {{ env.VAR_NAME }} and will be resolved at runtime.


🏃 Quickstart Example

from quantalogic_toolbox_mcp.tools import get_tools
import asyncio

async def main():
    # Discover core and dynamic tools
    tools = get_tools()

    # List configured servers
    from quantalogic_toolbox_mcp.tools import list_servers
    servers = await list_servers()
    print("Servers:", servers)

    # List tools on a server
    resources = await tools[0]('sqlite')  # mcp_list_tools
    print("Tools on sqlite:", resources)

    # Call a specific tool dynamically
    dynamic = [t for t in tools if hasattr(t, 'server_name') and t.server_name == 'sqlite'][0]
    result = await dynamic(input_file="/mcp/test.db")
    print("Result:", result)

asyncio.run(main())

🏛️ Architecture

%%{init: { 'theme': 'base', 'themeVariables': { 
    'primaryColor': '#A3C9E2', 
    'secondaryColor': '#B7E3CC', 
    'tertiaryColor': '#F9E0BB', 
    'lineColor': '#B5B5B5', 
    'fontFamily': 'Inter, Arial, sans-serif'
} }}%%
flowchart TD
    A[Load JSON configs] --> B{Cache valid?}
    B -- Yes --> C[Load servers & tools from cache]
    B -- No  --> D[Read & resolve configs]
    D --> E[Fetch tool lists & details]
    C & E --> F[Populate `tools_cache`]
    F --> G["get_tools()"]
    G --> H[Execute core or dynamic tools]
    H --> I[Parse & return results]

📖 API Reference

  • get_tools() → List[Callable]

    • Returns core functions and dynamic tool wrappers.
  • mcp_list_resources(server_name: str) → List[str]

  • mcp_list_tools(server_name: str) → List[str]

  • mcp_call_tool(server_name: str, tool_name: str, arguments: dict) → Any

  • list_servers() → List[str]

For full signatures and details, refer to toolboxes/quantalogic-toolbox-mcp/quantalogic_toolbox_mcp/tools.py.


🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests in tests/
  4. Run pytest and ruff .
  5. Submit a pull request against main

Please see CONTRIBUTING.md for more details.


📜 License

This project is licensed under the MIT License – see the LICENSE file for details.

Metadata

Release files for quantalogic_toolbox_mcp 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantalogic_toolbox_mcp 0.13.0
File Size Uploaded
quantalogic_toolbox_mcp-0.13.0.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quantalogic_toolbox_mcp 0.13.0
File Interpreter ABI Platform
quantalogic_toolbox_mcp-0.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.4 kB

Release files / quantalogic_toolbox_mcp-0.13.0.tar.gz

Download URL quantalogic_toolbox_mcp-0.13.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
568a142b3039c999ff5bb70780a6a26050b5a31647d1aee7696b7d5f7db37a4e
BLAKE2b-256 checksum
How to use checksums
85cab840e86b2d9f9e218a4722d5dc112fa8a3e0ba2baa6cb1e75331a291dfb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.8 Darwin/24.4.0

Release files / quantalogic_toolbox_mcp-0.13.0-py3-none-any.whl

Download URL quantalogic_toolbox_mcp-0.13.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7a7634c8164b5d080ee6ec7930afa986ae73d0ace1dc16caffa87b178296eea
BLAKE2b-256 checksum
How to use checksums
8a800fa61a5b5c195671e7a865708d49b6699803da27e08fbc20a34550a05730
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.8 Darwin/24.4.0

Release history Release notifications | RSS feed

This release

0.13.0 This release

2 release files

0.12.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page