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 (agent_call)
from cn_mcp import MCPClient
mcp = MCPClient(api_key="your-api-key")
session = mcp.agent_call("session_create")
session_id = session["session_id"]
try:
run = mcp.agent_call(
"terminal_exec",
session_id=session_id,
cmd="echo hello",
timeout_minutes=60,
)
print(run["stdout"])
zipped = mcp.agent_call("file_zip_session", session_id=session_id)
print(zipped["download_url"])
finally:
mcp.agent_call("session_dispose", session_id=session_id)
mcp.close()
For one-off workspace operations, the server can create the session for you:
run = mcp.agent_call(
"terminal_exec",
{"cmd": "python --version", "timeout_minutes": 2},
auto_create_session=True,
)
Tool-Call Examples
Files
import base64
payload = base64.b64encode(b"hello").decode("utf-8")
written = mcp.agent_call(
"file_write",
session_id=session_id,
path="reports/out.txt",
content_base64=payload,
)
files = mcp.agent_call("file_list", session_id=session_id)
mcp.agent_call("file_delete", file_id=written["file_id"])
file_list also discovers normal files created by terminal commands and
returns direct links for them.
Return download_url directly to users. It is a plain browser/download link
and remains usable after session cleanup.
Devices
devices = mcp.agent_call("device_list")
result = mcp.agent_call("device_set_state", device_name="living room light", state="off")
Search
results = mcp.agent_call("web_search", query="CircuitNotion")
print(results.get("organic_results", []))
Scheduler
task = mcp.agent_call("time_schedule", payload={"message": "follow up"}, in_seconds=300)
tasks = mcp.agent_call("time_scheduled_tasks")
mcp.agent_call("time_cancel", task_id=task["task_id"])
Database
rows = mcp.agent_call(
"db_query",
session_id=session_id,
sql="SELECT name FROM sqlite_master WHERE type = ?",
params=["table"],
)
mcp.agent_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.
Metadata
Release files for cn-mcp 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cn_mcp-0.3.8.tar.gz | 13.5 kB | With provenance | Details for cn_mcp-0.3.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cn_mcp-0.3.8-py3-none-any.whl | Python 3 | none | any | Details for cn_mcp-0.3.8-py3-none-any.whl |
Total release size: 29.3 kB
Release files / cn_mcp-0.3.8.tar.gz
| Download URL | cn_mcp-0.3.8.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f71f0bfd86419fe94ffb188975086d8d64f2d616385f501eef907fa5ad79c05
|
|
BLAKE2b-256 checksum How to use checksums |
8a2ba7bee83fa287e2bc3930b49fb3d45f5705716432641864ab0a5264783874
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logRelease files / cn_mcp-0.3.8-py3-none-any.whl
| Download URL | cn_mcp-0.3.8-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
391dda0c4755cd699d63618afa410964b01ece90bffdbdce46b07462fb324678
|
|
BLAKE2b-256 checksum How to use checksums |
d66aafe24b376d8f3247d35f91ddad1dde19b54f7692253b95ce082bdec3ab85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logSecurity for cn-mcp 0.3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cn_mcp-0.3.8.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.