Skip to content

About

The Meshery MCP Server extension - an MCP server that streamlines and accelerates creating Meshery designs

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

40 stars

Watchers

0 watching

Forks

Meshery Extensions

Meshery is an extensible, self-service engineering platform for the collaborative management of cloud and cloud native infrastructure.

Level of support for this repo Build and Test Go version Model Context Protocol Slack

Meshery MCP Server

Meshery MCP Server connects AI assistants to Meshery through the Model Context Protocol (MCP), an open standard for connecting AI applications to external systems. Any MCP-capable client, such as Claude Desktop, Claude Code, or an IDE agent, can then work with Meshery designs through one consistent interface instead of a custom integration per assistant.

It is an official Meshery Extension, written in Go, and runs as a standalone binary or container next to your Meshery deployment.

Project status

Note

Early development. The MCP server runs over stdio and over Streamable HTTP on localhost, but it does not call Meshery yet: its tools are placeholders that return a "not implemented" error.

Area Status
Configuration (env vars, config file, flags), logging, Meshery-style errors ✅ Done
Build, lint, tests, container image, CI ✅ Done
MCP server over stdio ✅ Done
MCP server over Streamable HTTP, localhost only, with an access key ✅ Done
Remote HTTP with MCP authorization (OAuth) Planned
Meshery API client Planned
MCP tools Placeholders (return "not implemented")
MCP resources and prompts Planned

Planned scope

In priority order, the server will support:

  1. Creating Meshery designs.
  2. Retrieving designs in the format the user asks for (for example JSON or YAML).
  3. Snapshotting Meshery designs.
  4. Dry-run results for design deployments.
  5. Defining and running performance tests, and retrieving their results.

These will be exposed through MCP's three building blocks:

  • Tools: Meshery operations the AI can invoke on the user's behalf.
  • Resources: Meshery data the AI can read as context.
  • Prompts: reusable prompt templates for common Meshery workflows.

Architecture

┌──────────────────────────────────────────────────────────────┐
│ MCP client: Claude Desktop, Claude Code, IDE agents, ...     │
│ starts the server (stdio) or connects to it (HTTP)           │
└──────────────────────────────────────────────────────────────┘
                                │  JSON-RPC over stdio, or Streamable HTTP on localhost
                                ▼
┌──────────────────────────────────────────────────────────────┐
│ meshery-mcp-server                                           │
│                                                              │
│ cmd/meshery-mcp-server  entrypoint: flags, logger, wiring    │
│ internal/config         settings from env vars and file      │
│ internal/logging        one log format for server and SDK    │
│ internal/auth           attaches the caller's token per call │
│ internal/mcp-server     MCP server over stdio or HTTP        │
│                                                              │
│ internal/tools          MCP tools          (placeholders)    │
│ internal/resources      MCP resources      (planned)         │
│ internal/prompts        MCP prompts        (planned)         │
│ internal/meshery        Meshery API client (stubbed)         │
│                                                              │
│ logs go to stderr; stdout is reserved for the protocol       │
└──────────────────────────────────────────────────────────────┘
                                │  HTTP(S) + provider token
                                ▼
┌──────────────────────────────────────────────────────────────┐
│ Meshery Server  (MESHERY_SERVER_URL)                         │
└──────────────────────────────────────────────────────────────┘

By default the MCP client launches the server and talks to it over stdin/stdout, so the server does not listen on any network address. With --transport http it listens instead at http://127.0.0.1:8080/mcp, on loopback only, and every request must carry an access key. Because stdout carries the protocol over stdio, all logs go to stderr.

Only cmd/meshery-mcp-server wires the packages together. internal/config is the only package that reads environment variables or the config file; the other packages receive plain values from main. See docs/config.md for details.

Repository structure

meshery-mcp-server/
├── .github/workflows/          # CI: lint, build and test, Docker image
├── build/                      # Shared Makefile includes
├── cmd/meshery-mcp-server/     # Entrypoint
├── docs/
│   └── config.md               # Configuration reference
├── helpers/
│   └── component_info.json     # Error-code metadata for Meshery's errorutil
├── internal/
│   ├── auth/                   # Per-request credentials
│   ├── config/                 # Configuration loading and validation
│   ├── logging/                # Log format and level for the server and the MCP SDK
│   ├── mcp-server/             # MCP server construction and transport
│   ├── meshery/                # Meshery API client
│   ├── prompts/                # MCP prompts
│   ├── resources/              # MCP resources
│   └── tools/                  # MCP tools
├── .dockerignore
├── .golangci.yml               # Lint configuration
├── config_example.yml          # Example config file
├── Dockerfile                  # Multi-stage build, distroless non-root runtime
├── go.mod / go.sum
└── Makefile                    # Build and development commands

Quick start

Prerequisites

Tool Version Needed for
Go as declared in go.mod Building and testing
golangci-lint v2.x make lint
Docker any recent version Container builds only

1. Clone and build

git clone https://github.com/meshery-extensions/meshery-mcp-server.git
cd meshery-mcp-server
make build            # writes bin/meshery-mcp-server

2. Configure

The server works with no configuration if Meshery runs at http://localhost:9081. Otherwise, set environment variables:

Variable Default Purpose
MESHERY_SERVER_URL http://localhost:9081 Meshery server to connect to
MESHERY_API_TOKEN (none) Meshery provider token. Environment only; never in the config file
MESHERY_MCP_TRANSPORT stdio stdio or http; also --transport
MESHERY_MCP_HOST 127.0.0.1 HTTP only, loopback addresses only; also --host
MESHERY_MCP_PORT 8080 HTTP only; also --port
MESHERY_MCP_ACCESS_KEY (none) HTTP only, required: the bearer token clients must send. Environment only
LOG_LEVEL info debug, info, warn or error
LOG_FORMAT text text for development, json for log collectors

To use a config file instead:

cp config_example.yml config.local.yaml   # *.local.yaml is gitignored

and pass it with --config config.local.yaml. Environment variables override the file.

docs/config.md is the full reference: precedence rules, token handling, Docker specifics and every error message.

3. Run

make run
make run ARGS="--config config.local.yaml"

This prints a startup line to stderr, then serves MCP over stdin/stdout until stdin closes or you press Ctrl+C:

time="..." level=info msg="starting meshery-mcp-server version=... commit=... meshery_url=http://localhost:9081 token_configured=false transport=stdio" app=meshery-mcp-server

To serve Streamable HTTP on localhost instead:

export MESHERY_MCP_ACCESS_KEY="$(openssl rand -hex 32)"
make run ARGS="--transport http --port 8080"   # http://127.0.0.1:8080/mcp

Clients must send Authorization: Bearer $MESHERY_MCP_ACCESS_KEY. To call the tools by hand, use the MCP Inspector: npx @modelcontextprotocol/inspector ./bin/meshery-mcp-server for stdio, or start it without arguments and connect to the HTTP URL with that header.

4. Run in a container

make docker-run

This builds the image and runs it over stdio. Inside a container, localhost refers to the container itself, so make docker-run points the server at http://host.docker.internal:9081 by default. Override it with DOCKER_MESHERY_SERVER_URL. MESHERY_API_TOKEN is forwarded from your shell.

5. Connect an MCP client

Note

The tools are placeholders for now: every call returns a "not implemented" error, and their descriptions say so.

MCP clients start the server themselves. For example, in Claude Desktop's configuration:

{
  "mcpServers": {
    "meshery": {
      "command": "/path/to/meshery-mcp-server",
      "env": {
        "MESHERY_SERVER_URL": "http://localhost:9081",
        "MESHERY_API_TOKEN": "<token>"
      }
    }
  }
}

Point the client at the binary or at docker run -i ..., never at make: Make prints its commands to stdout, which would corrupt the MCP stream. docs/config.md has the Docker version.

Development

Command Description
make build Build the binary for your platform into bin/
make run Build and run the binary; pass flags with ARGS="..."
make test Run unit tests
make coverage Run tests with the race detector and write coverage.txt
make lint Run golangci-lint
make fmt Format the code with gofmt
make clean Remove bin/ and coverage.txt
make docker-build Build the container image
make docker-run Build the image and run it over stdio
make or make show-help List all targets

Every pull request runs three CI jobs: golangci-lint, Build and unit tests (tidy check, build, tests with coverage), and Test Docker Image Build (builds the image and starts it). Run make lint and make coverage before opening one.

Errors follow Meshery's error conventions: each package defines its errors in error.go, with codes meshery-mcp-server-<number>. To add an error, use the next_error_code in helpers/component_info.json and increase it, so no number is used twice. To check your errors locally:

go run github.com/meshery/meshkit/cmd/errorutil -d . analyze -i ./helpers -o ./helpers

About Meshery Extensions

Meshery Extensions add capabilities to Meshery beyond its core platform. They live in the meshery-extensions organization, separate from the core meshery organization; the ecosystem expansion post explains why and how that organization is governed.

Related repositories:

Community and Contributing

Please do! Code and non-code contributions are welcome. This project is community-built and fosters collaboration. Contributors are expected to adhere to the CNCF Code of Conduct.

Jump into our Slack! Submit the community member form to access additional resources. Don't forget to join the Newcomers meeting held every Thursday!

Community

✔️ Star ⭐ the main meshery repo
✔️ Join any or all of the weekly meetings on the community calendar
✔️ Watch community meeting recordings
✔️ Access resources by completing a community member form
✔️ Discuss in the Meshery community forum
✔️ Not sure where to start? Grab an open issue with the help-wanted label

About

The Meshery MCP Server extension - an MCP server that streamlines and accelerates creating Meshery designs

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

40 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages