Skip to main content

Thin MCP server for Cisco CML2: openapi.json + generic authenticated REST.

Project description

cml2-mcp

Thin MCP server for Cisco CML2.

It deliberately avoids mirroring the CML API as typed (Pydantic) tools — every prior generation that did so broke when the controller shipped a schema change. Instead this server exposes only:

  • cml_openapi(refresh=False) — fetch CML's live openapi.json (cached 24 h).
  • cml_api(method, path, body=None) — generic authenticated REST call after /api/v0. Re-authenticates and retries once on HTTP 401.
  • Resource cml://openapi.json — same content as cml_openapi().

The model is expected to read the OpenAPI spec first and then craft calls.

Configuration

Required environment:

Var Example
CML_URL https://cml.example.net/
CML_USERNAME admin
CML_PASSWORD

Optional:

  • CML_VERIFY_SSL=true — verify TLS (default: off; CML often uses self-signed certs).
  • CML_CACHE_DIR — token / openapi cache directory (default: ~/.cache/cml/).

The token is written to $CML_CACHE_DIR/token with mode 0600.

Running

With uv directly from the source tree:

uv run cml2-mcp

After publishing to PyPI (or via uv tool install .):

uvx cml2-mcp

Claude Desktop / Claude Code registration

Wrap the command so the password is fetched from a secure store rather than appearing in plain text. Example with macOS Keychain:

{
  "mcpServers": {
    "cml2": {
      "command": "sh",
      "args": [
        "-c",
        "CML_PASSWORD=$(security find-generic-password -a <account> -s <service> -w) exec uvx cml2-mcp"
      ],
      "env": {
        "CML_URL": "https://cml.example.net/",
        "CML_USERNAME": "admin"
      }
    }
  }
}

For Claude Code:

claude mcp add cml2 -- sh -c 'CML_PASSWORD=$(security find-generic-password -a <account> -s <service> -w) exec uvx cml2-mcp'

(Set CML_URL / CML_USERNAME in the same env or via claude mcp add ... -e KEY=VAL.)

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

cml2_mcp-0.1.1.tar.gz (52.3 kB view details)

Uploaded Source

Built Distribution

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

cml2_mcp-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file cml2_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: cml2_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 52.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cml2_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d826a534d75797f83b4e60325733c77137dafa5c266bf70e080a6f60dc008205
MD5 f7c2176418b8377ca95affecae5bd107
BLAKE2b-256 cb9634ab0be4267a654ad34759852ff64ecb8bfb90a98341ab7f13d2fafacaa0

See more details on using hashes here.

File details

Details for the file cml2_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cml2_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cml2_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d65f9e0cb81b0748e0f238c249b4421fe3404d67aba1172d3dc519dd84af6cbf
MD5 c087172e28d1b0185bfdd59c6887e385
BLAKE2b-256 88a821bbe80cc14de0828684a606daa66c1baf69683851eea6404b28ae50e253

See more details on using hashes here.

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