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.0.tar.gz (47.8 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.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cml2_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cml2_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3fa5ab01c1bc058d01918a82b55effbcd8fb78ee2ecd4904fc055c629da7afad
MD5 8198021ca704a1bb3f5bed2ba0e53569
BLAKE2b-256 a58eea4cd038648e3338bf5d1d2e1e2ea2f8530d2490466d9043d8f318d04773

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cml2_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42505d5b43a041885456bc02a32f7641f77dcdcd87bfdccd62f36a435eec73ba
MD5 bc19d00a008bfa33a9d4f142c36aee0c
BLAKE2b-256 c37f7474de9f5a95ef9cba13450fb051be3b5cda8154ba059c3e87a3893753b1

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