Skip to main content

Polars Docs MCP

A FastMCP tool to search and retrieve Polars API documentation with support for multiple transport methods.

Features

  • Automatically discover Polars public components (classes, functions, submodules).
  • Search Polars API by component or query string.
  • Get current Polars version and package information.
  • Returns structured JSON with API signatures and descriptions.
  • Support for multiple transport methods: STDIO, Streamable HTTP, and SSE.
  • Integrates with mcp for seamless LLM-powered workflows.

By leveraging Python's built‑in introspection to reflectively discover every public class, function, and submodule in Polars at runtime, I eliminate the cost, fragility, and maintenance burden of web‑scraping or managing an external documentation database. This approach guarantees 100% up‑to‑date accuracy with every library release, requires no complex text cleaning or embedding pipelines, and avoids the heavy infrastructure overhead of semantic search—making it both simpler and far more efficient for real‑time API lookup.

Usage

{
    "mcpServers": {
        "polarsapifinder": {
            "command": "uv",
            "args": [
                "--directory",
                "/PATH/TO/polars-docs-mcp",
                "run",
                "polarsdocsfinder.py"
            ]
        }
    }
}

2. Manual Execution with Transport Options

STDIO (Default - Best for Claude Desktop)

python polarsdocsfinder.py
# or explicitly:
python polarsdocsfinder.py --transport stdio

Streamable HTTP (Best for Web Deployments)

python polarsdocsfinder.py --transport streamable-http
# With custom settings:
python polarsdocsfinder.py --transport streamable-http --host 0.0.0.0 --port 8080 --path /api/mcp

SSE (For Legacy Client Compatibility)

python polarsdocsfinder.py --transport sse
# With custom settings:
python polarsdocsfinder.py --transport sse --host 0.0.0.0 --port 9000

Command Line Arguments

  • --transport: Choose transport method (stdio, streamable-http, sse) - Default: stdio
  • --host: Host address for HTTP/SSE transports - Default: 127.0.0.1
  • --port: Port number for HTTP/SSE transports - Default: 8111
  • --path: URL path for streamable-http transport - Default: /mcp

3. Visual Testing of MCP Server

npx @modelcontextprotocol/inspector uv run polarsdocsfinder.py

MCP INspector

Requires Python 3.11+.

Tool Endpoints

  • get_polars_version(): Get current Polars version and package information.
  • list_polars_components(): List all high-level Polars API components.
  • search_polars_docs(api_refs: list[str] | None, query: str | None, max_results: int = 1000): Search and retrieve API signatures.
  • verify_polars_api(api_ref: str): Verify if a Polars API reference is valid.
  • list_all_modern_data_stacks(): List modern data stacks compatible with Polars.

Transport Methods

STDIO (Default)

  • Best for: Claude Desktop, local tools, command-line scripts
  • Usage: Direct integration with Claude Desktop configuration
  • Communication: Standard input/output streams

Streamable HTTP

  • Best for: Web deployments, REST API integration, browser-based clients
  • Usage: Run as HTTP service, connect via HTTP requests
  • Communication: HTTP POST requests to the specified endpoint

SSE (Server-Sent Events)

  • Best for: Compatibility with existing SSE clients, real-time streaming
  • Usage: Legacy system integration
  • Communication: Server-sent events over HTTP

Examples Snapshots

Claude

Claud2

Testing HTTP Transport

If running with HTTP transport, you can test the server:

# Start server
python polarsdocsfinder.py --transport streamable-http --port 8111

# Test with curl
curl -X POST http://127.0.0.1:8111/mcp \
  -H "Content-Type: application/json" \
  -d '{"method": "tools/list"}'

License

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

Contact

Created by ABC. Report issues or request features at https://github.com/HotTechStack/polars-docs-mcp/issues.

Metadata

Release files for iflow-mcp_hottechstack-polars-docs-mcp 0.1.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 iflow-mcp_hottechstack-polars-docs-mcp 0.1.0
File Size Uploaded
iflow_mcp_hottechstack_polars_docs_mcp-0.1.0.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_hottechstack-polars-docs-mcp 0.1.0
File Interpreter ABI Platform
iflow_mcp_hottechstack_polars_docs_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / iflow_mcp_hottechstack_polars_docs_mcp-0.1.0.tar.gz

Download URL iflow_mcp_hottechstack_polars_docs_mcp-0.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3bcbe7353f5a46d9f082260b80974bdef3392993966186ef9781b75455546775
BLAKE2b-256 checksum
How to use checksums
9fcc5d878688a470bab69113ae4703e7de0ff417207daf8f41f7257ebd958587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_hottechstack_polars_docs_mcp-0.1.0-py3-none-any.whl

Download URL iflow_mcp_hottechstack_polars_docs_mcp-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edb74ea4ec79bc48d8512e04539a8ba1c55ca592a8a40a2e90fca1cf209c51f7
BLAKE2b-256 checksum
How to use checksums
f15d0ba5b0479dbcbd9d140b28c45d22750b6e925cb44b0a5fc53e5de10a254a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

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