Skip to content

Add a Python MCP client example for adopters #38

Description

@madeinplutofabio

Summary

Ship a minimal Python script that drives ncp-mcp-server via the official MCP Python SDK. Adopters who do not use a GUI MCP-compatible host (or who want to integrate NCP directly into Python automation) currently have no canonical example. We have a working pattern already (examples/mcp/ci_smoke.py uses raw JSON-RPC); this issue adds the SDK-driven companion.

Why this is a good first issue

  • Self-contained: one new Python file under examples/mcp/.
  • No Rust knowledge needed; basic Python plus the well-documented MCP Python SDK is enough.
  • Acceptance criteria are concrete and testable.

Acceptance criteria

  • New file examples/mcp/python_client_example.py.
  • Uses the official mcp Python SDK (pip install mcp). Document the install step in the script's docstring.
  • Spawns the release-built ncp-mcp-server binary via mcp.client.stdio.stdio_client against examples/graphs/echo-pipeline/graph.yaml.
  • Performs initialize then tools/list then tools/call(name="org.ncp-examples.echo-pipeline", arguments={...}), closes stdin, asserts clean exit.
  • Prints the structuredContent returned by the tool call.
  • Cross-platform (Linux, macOS, Windows). Same constraints as ci_smoke.py (binary path uses .exe suffix on Windows).
  • Docstring explains: install, run, expected output.

Out of scope

  • Adding the script to CI (the existing ci_smoke.py is the required check; this script is an adopter example, not a CI gate).
  • Wrapping it as a CLI or library.

Where to read

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:examplesExample graphs, bricks, and adopter-facing samplesarea:mcpMCP adapter and MCP integration workgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions