Skip to main content

Python SDK for CircuitNotion MCP Server

Project description

CircuitNotion MCP SDK

Python SDK for the CircuitNotion MCP server.

Installation

pip install cn-mcp

For local development against a local MCP server:

export MCP_API_KEY="your-api-key"
export MCP_BASE_URL="http://localhost:8000"

Quick Start (tool_call only)

from cn_mcp import MCPClient

mcp = MCPClient(api_key="your-api-key")

session = mcp.tool_call("session_create")
session_id = session["session_id"]

try:
    run = mcp.tool_call(
        "terminal_exec",
        session_id=session_id,
        cmd="echo hello",
        timeout_minutes=60,
    )
    print(run["stdout"])

    zipped = mcp.tool_call("file_zip_session", session_id=session_id)
    print(zipped["download_url"])
finally:
    mcp.tool_call("session_dispose", session_id=session_id)
    mcp.close()

Tool-Call Examples

Files

import base64

payload = base64.b64encode(b"hello").decode("utf-8")
written = mcp.tool_call(
    "file_write",
    session_id=session_id,
    path="reports/out.txt",
    content_base64=payload,
)
files = mcp.tool_call("file_list", session_id=session_id)
binary = mcp.tool_call("file_download", file_id=written["file_id"])
mcp.tool_call("file_delete", file_id=written["file_id"])

Devices

devices = mcp.tool_call("device_list")
result = mcp.tool_call("device_set_state", device_name="living room light", state="off")

Search

results = mcp.tool_call("web_search", query="CircuitNotion")
print(results.get("organic_results", []))

Scheduler

task = mcp.tool_call("time_schedule", payload={"message": "follow up"}, in_seconds=300)
tasks = mcp.tool_call("time_scheduled_tasks")
mcp.tool_call("time_cancel", task_id=task["task_id"])

Database

rows = mcp.tool_call(
    "db_query",
    session_id=session_id,
    sql="SELECT name FROM sqlite_master WHERE type = ?",
    params=["table"],
)

mcp.tool_call(
    "db_execute",
    session_id=session_id,
    sql="INSERT INTO notes (body) VALUES (?)",
    params=["hello"],
)

Timeout Note

The SDK defaults to an agent-friendly HTTP timeout and automatically extends timeout behavior for long-running tools such as terminal_exec.

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

cn_mcp-0.3.6.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

cn_mcp-0.3.6-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file cn_mcp-0.3.6.tar.gz.

File metadata

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

File hashes

Hashes for cn_mcp-0.3.6.tar.gz
Algorithm Hash digest
SHA256 cfd934fb5ad4495c985aa09e80d23c46d1fc9761d66bf3dc8bf02385a36a6eaa
MD5 4235e5d8d7b1f3436897a6ab2e18518e
BLAKE2b-256 9e13229443f9a108044d0a24820ce64d9e8d04fbc5084dea119cf17e2f8efd8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cn_mcp-0.3.6.tar.gz:

Publisher: pypi-publish.yml on ntirushwajeanmarc/cn-mcp-sdk

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

File details

Details for the file cn_mcp-0.3.6-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cn_mcp-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d89f7d5852f48dafab6e7602a2695d9a191728ade67610feafd3a18b100ec3ff
MD5 447c3fed406d176c7a29fa013f32ae5c
BLAKE2b-256 ba9a26902d72abce562c5b18ee43e46b9f6b5c8a86388e77759e5d0f7cf6b1e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cn_mcp-0.3.6-py3-none-any.whl:

Publisher: pypi-publish.yml on ntirushwajeanmarc/cn-mcp-sdk

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