Skip to content

Command-line tool for scaffolding Model Context Protocol (MCP) servers in different languages. Generates ready-to-use templates with optional Docker support and testing utilities.

License

Notifications You must be signed in to change notification settings

aawadall/mcpcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codacy Badge Codacy Badge Release

mcpcli

A CLI tool to scaffold Model Context Protocol (MCP) server projects in Go and other languages. It generates ready-to-use MCP server templates with support for multiple transports, Docker, and example resources/tools.

Current Version: v0.4.1 (latest release)

Learn more about the Model Context Protocol at the official introduction page.

Features

  • Generate new MCP server projects with a single command
  • Supports multiple languages (Go, Node.js, Java, Python)
  • Choose transport method (stdio, rest, websocket)
  • Optional Docker support
  • Example resources and tools included
  • Interactive and non-interactive modes
  • Test MCP server resources, tools, and capabilities

Installation

Clone the repository and build the CLI:

git clone https://github.com/aawadall/mcpcli.git
cd mcpcli
go build -o mcpcli ./cmd/mcpcli

Available Commands

  • generate (aliases: gen, g): Generate a new MCP server project
  • test: Test MCP server resources, tools, capabilities, and initialization

Usage

Generate a new MCP server project

./mcpcli generate my-server --language golang --transport stdio --docker --examples

Or use interactive mode (if required options are missing):

./mcpcli generate

Generate Flags

  • --name, -n Project name
  • --language, -l Programming language (golang, python, java, javascript/Node.js)
  • --transport, -t Transport method (stdio, rest, websocket)
  • --docker, -d Include Docker support
  • --examples, -e Include example resources and tools
  • --output, -o Output directory (default: project name)
  • --force, -f Overwrite existing directory

Test an MCP server

./mcpcli test --config configs/mcp-config.json --all

Or use interactive mode (if no flags are provided):

./mcpcli test

Test Flags

  • --config, -c Path to MCP configuration file
  • --all Test all components (resources, tools, capabilities, init)
  • --resources Test resources
  • --tools Test tools
  • --capabilities Test capabilities
  • --init Test initialization
  • --script, -f Path to test script file

Global Flags

  • --verbose, -v Enable verbose output
  • --quiet, -q Suppress output

Project Structure

  • cmd/ Entrypoint for the CLI
  • internal/ Core logic, generators, handlers, templates
  • pkg/ Shared packages

Generated Project Example

A generated Go MCP server project includes:

  • cmd/server/main.go - Main server entrypoint
  • internal/handlers/ - Request handlers
  • pkg/mcp/ - MCP protocol types and client
  • configs/mcp-config.json - Server configuration
  • Dockerfile - Docker support (optional)
  • examples/ - Example usage (optional)

A generated Node.js MCP server project includes:

  • src/index.js - Main server entrypoint
  • src/handlers/ - Request handlers
  • configs/mcp-config.json - Server configuration
  • Dockerfile - Docker support (optional)

Testing

Run go test ./... -cover to execute the unit tests. Overall coverage should remain above 85%. Recent additions include tests for internal/commands/test.go and error handling cases in internal/generators/node_test.go to ensure the CLI testing workflow behaves as expected. See the testing guide for more details on running the tests for mcpcli v0.4.1 (latest). All contributions must maintain this minimum coverage level.

Contributing

Contributions are welcome! Please open issues or pull requests.

Releasing

The release workflow builds cross-platform archives. For details on packaging mcpcli for Homebrew, APT, and Chocolatey see the releasing guide.

License

MIT License


Further Reading

About

Command-line tool for scaffolding Model Context Protocol (MCP) servers in different languages. Generates ready-to-use templates with optional Docker support and testing utilities.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages