https://github.com/aawadall/mcpcli
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.
https://github.com/aawadall/mcpcli
cli code-generator devtools golang java mcp model-context-protocol model-context-protocol-servers nodejs python scaffold-template scaffolding testing
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/aawadall/mcpcli
- Owner: aawadall
- License: mit
- Created: 2025-07-14T00:09:17.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-02T21:41:15.000Z (11 months ago)
- Last Synced: 2025-10-31T06:47:21.331Z (8 months ago)
- Topics: cli, code-generator, devtools, golang, java, mcp, model-context-protocol, model-context-protocol-servers, nodejs, python, scaffold-template, scaffolding, testing
- Language: Go
- Homepage: https://aawadall.github.io/mcpcli/
- Size: 326 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://app.codacy.com/gh/aawadall/mcpcli/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://app.codacy.com/gh/aawadall/mcpcli/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)
[](https://github.com/aawadall/mcpcli/releases)
# 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](https://modelcontextprotocol.io/introduction).
## 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:
```bash
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
```bash
./mcpcli generate my-server --language golang --transport stdio --docker --examples
```
Or use interactive mode (if required options are missing):
```bash
./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
```bash
./mcpcli test --config configs/mcp-config.json --all
```
Or use interactive mode (if no flags are provided):
```bash
./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](doc/testing.md) 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](.github/workflows/release.yml) builds cross-platform archives.
For details on packaging `mcpcli` for Homebrew, APT, and Chocolatey see
[the releasing guide](doc/releasing.md).
## License
MIT License
---
## Further Reading
- [Model Context Protocol Introduction](https://modelcontextprotocol.io/introduction)