Agent Server MCP server

Provides a foundation for building persistent agent systems with memory storage, user authentication, and n8n workflow integration designed for SaaS deployment and monetization.
Back to servers
Setup instructions
Provider
Matthew Smith
Release date
Jun 06, 2025
Language
JavaScript
Stats
2 stars

The MCP Agent Server is an open-source platform that serves as a "brain" for AI employees, designed to work seamlessly with n8n and other workflow engines. It enables users to create, manage, and improve persistent AI agents with their own memory and learning capabilities through a natural language interface.

Installation

Prerequisites

  • Docker and Docker Compose
  • Node.js (for local development)

Quick Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/mcp-agent-server.git
    cd mcp-agent-server
    
  2. Copy over your docs and memory folders if needed

  3. Build and run with Docker Compose:

    docker-compose up --build
    
  4. Access the MCP server at http://localhost:4000

Alternative Installation

If you prefer to set up without Docker initially:

  1. Ensure Node.js is installed
  2. Remove any comments from package.json
  3. Install dependencies:
    npm install
    
  4. Start the server:
    npm start
    

Using the MCP Agent Server

API Authentication

All endpoints (except /health, /users/register, and /users/login) require an x-api-key header for authentication. You'll need to create and manage API keys as described below.

User and API Key Management

Creating a New User

Using PowerShell:

Invoke-RestMethod -Uri "http://localhost:4000/users/register" -Method Post -ContentType "application/json" -Body '{"email": "[email protected]", "password": "yourpassword"}'

Using curl:

curl -X POST http://localhost:4000/users/register -H "Content-Type: application/json" -d '{"email": "[email protected]", "password": "yourpassword"}'

Logging In and Getting an API Key

Using PowerShell:

$login = Invoke-RestMethod -Uri "http://localhost:4000/users/login" -Method Post -ContentType "application/json" -Body '{"email": "[email protected]", "password": "yourpassword"}'
$apiKey = $login.apiKey

Using curl:

curl -X POST http://localhost:4000/users/login -H "Content-Type: application/json" -d '{"email": "[email protected]", "password": "yourpassword"}'

Managing API Keys

List all your API keys (PowerShell):

Invoke-RestMethod -Uri "http://localhost:4000/users/me/api-keys" -Method Get -Headers @{ "x-api-key" = $apiKey }

Create a new API key (PowerShell):

Invoke-RestMethod -Uri "http://localhost:4000/users/me/api-keys" -Method Post -Headers @{ "x-api-key" = $apiKey }

Revoke an API key (PowerShell):

Invoke-RestMethod -Uri "http://localhost:4000/users/me/api-keys/1" -Method Delete -Headers @{ "x-api-key" = $apiKey }

Working with Agents

Creating an Agent

Using PowerShell:

$headers = @{ "x-api-key" = "your-api-key" }
Invoke-RestMethod -Uri "http://localhost:4000/agents" -Method Post -Headers $headers -ContentType "application/json" -Body '{"name": "Test Agent"}'

Using curl:

curl -X POST http://localhost:4000/agents -H "Content-Type: application/json" -H "x-api-key: your-api-key" -d '{"name": "Test Agent"}'

Managing Agent Memory and Feedback

Add memory/feedback (PowerShell):

Invoke-RestMethod -Uri "http://localhost:4000/agents/1/memory" -Method Post -Headers $headers -ContentType "application/json" -Body '{"content": "Agent completed onboarding."}'

List memory/feedback (PowerShell):

Invoke-RestMethod -Uri "http://localhost:4000/agents/1/memory" -Method Get -Headers $headers

Trigger agent action (PowerShell):

Invoke-RestMethod -Uri "http://localhost:4000/agents/1/trigger" -Method Post -Headers $headers

Using curl:

# Add memory
curl -X POST http://localhost:4000/agents/1/memory -H "Content-Type: application/json" -H "x-api-key: your-api-key" -d '{"content": "Agent completed onboarding."}'

# List memory
curl http://localhost:4000/agents/1/memory -H "x-api-key: your-api-key"

# Trigger agent
curl -X POST http://localhost:4000/agents/1/trigger -H "x-api-key: your-api-key"

Database Management

The MCP Agent Server handles database migrations automatically on container startup. If you're extending the server with new models or fields:

  1. Edit the schema in prisma/schema.prisma
  2. Run the migration command with your Docker Postgres running:
    npx prisma migrate dev --name <description>
    
  3. Commit the generated migration files in prisma/migrations/ to your repository

All migrations will be applied automatically on deployment or container rebuild.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "agent-server" '{"command":"docker-compose","args":["up","--build"],"cwd":"${workspaceFolder}"}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "agent-server": {
            "command": "docker-compose",
            "args": [
                "up",
                "--build"
            ],
            "cwd": "${workspaceFolder}"
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "agent-server": {
            "command": "docker-compose",
            "args": [
                "up",
                "--build"
            ],
            "cwd": "${workspaceFolder}"
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later