This commit is contained in:
373
README.md
373
README.md
@@ -65,204 +65,209 @@ The coordinator automatically manages external MCP servers based on configuratio
|
||||
}
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
## Setup
|
||||
|
||||
Choose one of these installation methods:
|
||||
|
||||
[Docker](#1-start-nats-server)
|
||||
<details>
|
||||
<summary>Docker</summary>
|
||||
|
||||
[Manual Installation](#manual-setup)
|
||||
### 1. Start NATS Server
|
||||
|
||||
- **Elixir**: 1.16+ with OTP 26+
|
||||
- **Node.js**: 18+ (for some MCP servers)
|
||||
- **uv**: If using python MCP servers
|
||||
First, start a NATS server that the Agent Coordinator can connect to:
|
||||
|
||||
### Docker Setup
|
||||
```bash
|
||||
# Start NATS server with persistent storage
|
||||
docker run -d \
|
||||
--name nats-server \
|
||||
--network agent-coordinator-net \
|
||||
-p 4222:4222 \
|
||||
-p 8222:8222 \
|
||||
-v nats_data:/data \
|
||||
nats:2.10-alpine \
|
||||
--jetstream \
|
||||
--store_dir=/data \
|
||||
--max_mem_store=1Gb \
|
||||
--max_file_store=10Gb
|
||||
|
||||
#### 1. Start NATS Server
|
||||
# Create the network first if it doesn't exist
|
||||
docker network create agent-coordinator-net
|
||||
```
|
||||
|
||||
First, start a NATS server that the Agent Coordinator can connect to:
|
||||
### 2. Configure Your AI Tools
|
||||
|
||||
```bash
|
||||
# Start NATS server with persistent storage
|
||||
docker run -d \
|
||||
--name nats-server \
|
||||
--network agent-coordinator-net \
|
||||
-p 4222:4222 \
|
||||
-p 8222:8222 \
|
||||
-v nats_data:/data \
|
||||
nats:2.10-alpine \
|
||||
--jetstream \
|
||||
--store_dir=/data \
|
||||
--max_mem_store=1Gb \
|
||||
--max_file_store=10Gb
|
||||
**For STDIO Mode (Recommended - Direct MCP Integration):**
|
||||
|
||||
# Create the network first if it doesn't exist
|
||||
docker network create agent-coordinator-net
|
||||
```
|
||||
First, create a Docker network and start the NATS server:
|
||||
|
||||
#### 2. Configure Your AI Tools
|
||||
```bash
|
||||
# Create network for secure communication
|
||||
docker network create agent-coordinator-net
|
||||
|
||||
**For STDIO Mode (Recommended - Direct MCP Integration):**
|
||||
# Start NATS server
|
||||
docker run -d \
|
||||
--name nats-server \
|
||||
--network agent-coordinator-net \
|
||||
-p 4222:4222 \
|
||||
-v nats_data:/data \
|
||||
nats:2.10-alpine \
|
||||
--jetstream \
|
||||
--store_dir=/data \
|
||||
--max_mem_store=1Gb \
|
||||
--max_file_store=10Gb
|
||||
```
|
||||
|
||||
First, create a Docker network and start the NATS server:
|
||||
Then add this configuration to your VS Code `mcp.json` configuration file via `ctrl + shift + p` → `MCP: Open User Configuration` or `MCP: Open Remote User Configuration` if running on a remote server:
|
||||
|
||||
```bash
|
||||
# Create network for secure communication
|
||||
docker network create agent-coordinator-net
|
||||
|
||||
# Start NATS server
|
||||
docker run -d \
|
||||
--name nats-server \
|
||||
--network agent-coordinator-net \
|
||||
-p 4222:4222 \
|
||||
-v nats_data:/data \
|
||||
nats:2.10-alpine \
|
||||
--jetstream \
|
||||
--store_dir=/data \
|
||||
--max_mem_store=1Gb \
|
||||
--max_file_store=10Gb
|
||||
```
|
||||
|
||||
Then add this configuration to your VS Code `mcp.json` configuration file via `ctrl + shift + p` → `MCP: Open User Configuration` or `MCP: Open Remote User Configuration` if running on a remote server:
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"agent-coordinator": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"--network=agent-coordinator-net",
|
||||
"-v=./mcp_servers.json:/app/mcp_servers.json:ro",
|
||||
"-v=/path/to/your/workspace:/workspace:rw",
|
||||
"-e=NATS_HOST=nats-server",
|
||||
"-e=NATS_PORT=4222",
|
||||
"-i",
|
||||
"--rm",
|
||||
"ghcr.io/rooba/agentcoordinator:latest"
|
||||
],
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Important Notes for File System Access:**
|
||||
|
||||
If you're using MCP filesystem servers, mount the directories they need access to:
|
||||
|
||||
```json
|
||||
{
|
||||
"args": [
|
||||
"run",
|
||||
"--network=agent-coordinator-net",
|
||||
"-v=./mcp_servers.json:/app/mcp_servers.json:ro",
|
||||
"-v=/home/user/projects:/home/user/projects:rw",
|
||||
"-v=/path/to/workspace:/workspace:rw",
|
||||
"-e=NATS_HOST=nats-server",
|
||||
"-e=NATS_PORT=4222",
|
||||
"-i",
|
||||
"--rm",
|
||||
"ghcr.io/rooba/agentcoordinator:latest"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**For HTTP/WebSocket Mode (Alternative - Web API Access):**
|
||||
|
||||
If you prefer to run as a web service instead of stdio:
|
||||
|
||||
```bash
|
||||
# Create network first
|
||||
docker network create agent-coordinator-net
|
||||
|
||||
# Start NATS server
|
||||
docker run -d \
|
||||
--name nats-server \
|
||||
--network agent-coordinator-net \
|
||||
-p 4222:4222 \
|
||||
-v nats_data:/data \
|
||||
nats:2.10-alpine \
|
||||
--jetstream \
|
||||
--store_dir=/data \
|
||||
--max_mem_store=1Gb \
|
||||
--max_file_store=10Gb
|
||||
|
||||
# Run Agent Coordinator in HTTP mode
|
||||
docker run -d \
|
||||
--name agent-coordinator \
|
||||
--network agent-coordinator-net \
|
||||
-p 8080:4000 \
|
||||
-v ./mcp_servers.json:/app/mcp_servers.json:ro \
|
||||
-v /path/to/workspace:/workspace:rw \
|
||||
-e NATS_HOST=nats-server \
|
||||
-e NATS_PORT=4222 \
|
||||
-e MCP_INTERFACE_MODE=http \
|
||||
-e MCP_HTTP_PORT=4000 \
|
||||
ghcr.io/rooba/agentcoordinator:latest
|
||||
```
|
||||
|
||||
Then access via HTTP API at `http://localhost:8080/mcp` or configure your MCP client to use the HTTP endpoint.
|
||||
|
||||
Create or edit `mcp_servers.json` in your project directory to configure external MCP servers:
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"mcp_filesystem": {
|
||||
"type": "stdio",
|
||||
"command": "bunx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"],
|
||||
"auto_restart": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Manual Setup
|
||||
|
||||
#### Clone the Repository
|
||||
|
||||
> It is suggested to install Elixir (and Erlang) via [asdf](https://asdf-vm.com/) for easy version management.
|
||||
> NATS can be found at [nats.io](https://github.com/nats-io/nats-server/releases/latest), or via Docker
|
||||
|
||||
```bash
|
||||
git clone https://github.com/rooba/agentcoordinator.git
|
||||
cd agentcoordinator
|
||||
mix deps.get
|
||||
mix compile
|
||||
```
|
||||
|
||||
#### Start the MCP Server directly
|
||||
|
||||
```bash
|
||||
# Start the MCP server directly
|
||||
export MCP_INTERFACE_MODE=stdio # or http / websocket
|
||||
# export MCP_HTTP_PORT=4000 # if using http mode
|
||||
|
||||
./scripts/mcp_launcher.sh
|
||||
|
||||
# Or in development mode
|
||||
mix run --no-halt
|
||||
```
|
||||
|
||||
### Run via VS Code or similar tools
|
||||
|
||||
Add this to your `mcp.json` or `mcp_servers.json` depending on your tool:
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"agent-coordinator": {
|
||||
"command": "/path/to/agent_coordinator/scripts/mcp_launcher.sh",
|
||||
"args": [],
|
||||
"env": {
|
||||
"MIX_ENV": "prod",
|
||||
"NATS_HOST": "localhost",
|
||||
"NATS_PORT": "4222"
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"agent-coordinator": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"--network=agent-coordinator-net",
|
||||
"-v=./mcp_servers.json:/app/mcp_servers.json:ro",
|
||||
"-v=/path/to/your/workspace:/workspace:rw",
|
||||
"-e=NATS_HOST=nats-server",
|
||||
"-e=NATS_PORT=4222",
|
||||
"-i",
|
||||
"--rm",
|
||||
"ghcr.io/rooba/agentcoordinator:latest"
|
||||
],
|
||||
"type": "stdio"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
**Important Notes for File System Access:**
|
||||
|
||||
If you're using MCP filesystem servers, mount the directories they need access to:
|
||||
|
||||
```json
|
||||
{
|
||||
"args": [
|
||||
"run",
|
||||
"--network=agent-coordinator-net",
|
||||
"-v=./mcp_servers.json:/app/mcp_servers.json:ro",
|
||||
"-v=/home/user/projects:/home/user/projects:rw",
|
||||
"-v=/path/to/workspace:/workspace:rw",
|
||||
"-e=NATS_HOST=nats-server",
|
||||
"-e=NATS_PORT=4222",
|
||||
"-i",
|
||||
"--rm",
|
||||
"ghcr.io/rooba/agentcoordinator:latest"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**For HTTP/WebSocket Mode (Alternative - Web API Access):**
|
||||
|
||||
If you prefer to run as a web service instead of stdio:
|
||||
|
||||
```bash
|
||||
# Create network first
|
||||
docker network create agent-coordinator-net
|
||||
|
||||
# Start NATS server
|
||||
docker run -d \
|
||||
--name nats-server \
|
||||
--network agent-coordinator-net \
|
||||
-p 4222:4222 \
|
||||
-v nats_data:/data \
|
||||
nats:2.10-alpine \
|
||||
--jetstream \
|
||||
--store_dir=/data \
|
||||
--max_mem_store=1Gb \
|
||||
--max_file_store=10Gb
|
||||
|
||||
# Run Agent Coordinator in HTTP mode
|
||||
docker run -d \
|
||||
--name agent-coordinator \
|
||||
--network agent-coordinator-net \
|
||||
-p 8080:4000 \
|
||||
-v ./mcp_servers.json:/app/mcp_servers.json:ro \
|
||||
-v /path/to/workspace:/workspace:rw \
|
||||
-e NATS_HOST=nats-server \
|
||||
-e NATS_PORT=4222 \
|
||||
-e MCP_INTERFACE_MODE=http \
|
||||
-e MCP_HTTP_PORT=4000 \
|
||||
ghcr.io/rooba/agentcoordinator:latest
|
||||
```
|
||||
|
||||
Then access via HTTP API at `http://localhost:8080/mcp` or configure your MCP client to use the HTTP endpoint.
|
||||
|
||||
Create or edit `mcp_servers.json` in your project directory to configure external MCP servers:
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"mcp_filesystem": {
|
||||
"type": "stdio",
|
||||
"command": "bunx",
|
||||
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"],
|
||||
"auto_restart": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Manual Setup</summary>
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- **Elixir**: 1.16+ with OTP 26+
|
||||
- **Node.js**: 18+ (for some MCP servers)
|
||||
- **uv**: If using python MCP servers
|
||||
|
||||
### Clone the Repository
|
||||
|
||||
It is suggested to install Elixir (and Erlang) via [asdf](https://asdf-vm.com/) for easy version management.
|
||||
|
||||
NATS can be found at [nats.io](https://github.com/nats-io/nats-server/releases/latest), or via Docker
|
||||
|
||||
```bash
|
||||
git clone https://github.com/rooba/agentcoordinator.git
|
||||
cd agentcoordinator
|
||||
mix deps.get
|
||||
mix compile
|
||||
```
|
||||
|
||||
### Start the MCP Server directly
|
||||
|
||||
```bash
|
||||
# Start the MCP server directly
|
||||
export MCP_INTERFACE_MODE=stdio # or http / websocket
|
||||
# export MCP_HTTP_PORT=4000 # if using http mode
|
||||
|
||||
./scripts/mcp_launcher.sh
|
||||
|
||||
# Or in development mode
|
||||
mix run --no-halt
|
||||
```
|
||||
|
||||
### Run via VS Code or similar tools
|
||||
|
||||
Add this to your `mcp.json` or `mcp_servers.json` depending on your tool:
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"agent-coordinator": {
|
||||
"command": "/path/to/agent_coordinator/scripts/mcp_launcher.sh",
|
||||
"args": [],
|
||||
"env": {
|
||||
"MIX_ENV": "prod",
|
||||
"NATS_HOST": "localhost",
|
||||
"NATS_PORT": "4222"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user