lunar
lunar.dev: Agent native MCP Gateway for governance and security
claude mcp add --transport stdio thelunarcompany-lunar node path/to/server.js \ --env LUNAR_ENV="production or development" \ --env LUNAR_CONFIG_PATH="path/to/config.json"
How to use
Lunar MCP is part of the Lunar.dev platform designed to centralize and govern access to third-party APIs across applications and AI agents. The Lunar MCP server acts as a gateway and policy engine, enabling live visibility into outbound API traffic, enforcing AI-aware access controls, shaping traffic with rate limits and retries, and consolidating multiple MCP servers into a single, manageable surface. With Lunar MCP you can apply fine-grained rules to tool calls, govern agent actions, and optimize costs and performance across your API ecosystem. The server is designed to plug into the Lunar Proxy and Lunar MCPX stack for a scalable, zero-code aggregation of multiple MCP instances, giving you unified API access and governance across teams and workloads.
To use Lunar MCP effectively, start the server and point your applications to the Lunar MCP gateway as the central API layer. You can define policies to control tool usage, throttle or prioritize specific call patterns, and monitor real-time metrics such as latency, errors, token usage, and cost. If you are combining Lunar MCP with Lunar MCPX, you can route diverse MCP servers through a single gateway, enabling unified authentication, observability, and management across all external API interactions.
How to install
Prerequisites:
- Node.js and npm installed on your system
- Basic familiarity with MCP (Model Context Protocol) concepts and policy definitions
Step 1: Prepare your environment
- Ensure you have a working directory for the Lunar MCP server
- Create a config directory if needed
Step 2: Install dependencies
- If the project is published as an npm package or includes a package.json, install it using npm or yarn
Step 3: Configure environment
-
Create a config.json (or use your existing config path) and define the mcpServers entry. Example:
{ "mcpServers": { "thelunar-lunar": { "command": "node", "args": ["path/to/server.js"], "env": { "LUNAR_ENV": "production", "LUNAR_CONFIG_PATH": "path/to/config.json" } } } }
Step 4: Run the server
-
Start the server using the command defined in the mcp_config
Example (based on the placeholder config): npm install # if there is a package.json in the project node path/to/server.js
Step 5: Verify and connect clients
- Point client applications to the Lunar MCP gateway endpoint and ensure the policy definitions are loaded and active
- Monitor the gateway via the provided metrics endpoints or dashboards
Additional notes
Tips and common considerations:
- If you’re running multiple MCP servers under Lunar MCPX, ensure each server has a unique identifier (e.g., the server name or slug) in the configuration to avoid collisions.
- For production environments, consider using a process manager (like pm2 or systemd) to keep the MCP server running and to auto-restart on failures.
- Expose and secure the MCP gateway with proper authentication and network controls to prevent unauthorized API access.
- Keep policy definitions versioned and backed up; use a centralized config repository to track changes over time.
- Monitor metrics such as latency, error rate, and token usage to detect abnormal behavior and to tune rate limits and retries accordingly.
- If you plan to aggregate multiple MCP servers with Lunar MCPX, define clear routing rules and tenants to segregate traffic between teams and workloads.
Related MCP Servers
mcp-for-beginners
This open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
metamcp
MCP Aggregator, Orchestrator, Middleware, Gateway in one docker
mcp-router
A Unified MCP Server Management App (MCP Manager).
agent
A unified Model Context Protocol server implementation that aggregates multiple MCP servers into one.
turbomcp
A full featured, enterprise grade rust MCP SDK
MCP-Dandan
MCP Security Solution for Agentic AI — real-time proxying, behavior analysis, and malicious tool detection