Quick Start
11/27/25Less than 1 minute
Quick Start
This guide will help you quickly install and run MCP-ANY-REST.
Prerequisites
- Rust 1.70+ (2021 edition)
- An accessible REST service (e.g. ZenTao)
- Configured environment variables
Installation
Clone the repository:
git clone <repository-url> cd mcp-any-restBuild the project:
cargo build --release
Running the Server
The server supports flexible configuration directory management:
- Command Line Specification: Use
--config-dirto specify a custom configuration directory - Auto Detection: If not specified, the server will automatically use the
configdirectory relative to the executable
# Run with custom configuration directory
cargo run --bin mcp-any-rest -- --transport http --config-dir /path/to/your/config
# Run in stdio mode (using config directory relative to executable)
cargo run --bin mcp-any-rest -- --transport stdio
# Run in release mode with custom configuration directory
cargo run --release --bin mcp-any-rest -- --transport http --config-dir ./my-config
# Run with default configuration (config directory relative to executable)
./target/release/mcp-any-rest --transport httpZML Tool Usage
The project provides a zml tool for managing ZML modules.
Common Commands
List Modules (using default configuration directory):
cargo run --bin zml -- listCompile Module (read from file and output JSON):
cargo run --bin zml -- compile -i config/zml/project.zml > project.jsonPretty Print Output:
cargo run --bin zml -- compile -i config/zml/project.zml --pretty
Example: Defining and Compiling a Module
Create a simple project.zml file:
module project {
version: "1.0.0"
description: "Project service"
enabled: true
access_level: public
type project_user {
id: integer
account: string
}
method get_project_list {
description: "Get project list"
http_method: GET
uri: "projects"
params {
page: integer = 1
limit: integer = 20
}
response: object {
page: integer
total: integer
}
}
}Compile the module:
cargo run --bin zml -- compile -i config/zml/project.zml --pretty