Serve Command

The arc serve command allows you to serve the Arc Memory knowledge graph via the Memory Control Protocol (MCP), making it accessible to other applications and tools.

Usage

arc serve <subcommand> [options]

Subcommands

start

Start the MCP server.

arc serve start [options]

status

Check the status of the MCP server.

arc serve status

stop

Stop the MCP server.

arc serve stop

Options

OptionDescription
--host <host>Host to bind the server to (default: localhost)
--port <port>Port to bind the server to (default: 8000)
--db-path <path>Path to the knowledge graph database (default: .arc/memory.db)
--log-level <level>Log level: debug, info, warning, error (default: info)
--daemonRun the server as a daemon process
--debugEnable debug mode

Examples

Starting the Server

arc serve start

This will start the MCP server on the default host and port.

Specifying Host and Port

arc serve start --host 0.0.0.0 --port 9000

This will start the MCP server on all interfaces on port 9000.

Running as a Daemon

arc serve start --daemon

This will start the MCP server as a background process.

Checking Server Status

arc serve status

This will show the current status of the MCP server, including uptime, connected clients, and resource usage.

Stopping the Server

arc serve stop

This will stop the running MCP server.

Memory Control Protocol (MCP)

The Memory Control Protocol is a JSON-RPC based protocol that allows clients to query and interact with the Arc Memory knowledge graph. It provides a standardized interface for:

  • Querying the knowledge graph
  • Retrieving node and edge information
  • Traversing relationships
  • Executing complex graph queries

Client Libraries

The following client libraries are available for interacting with the MCP server:

  • Python: arc-memory-client
  • JavaScript: arc-memory-js-client
  • Go: arc-memory-go-client

API Endpoints

The MCP server exposes the following API endpoints:

EndpointDescription
/queryExecute a graph query
/nodeGet information about a specific node
/edgeGet information about a specific edge
/traverseTraverse the graph from a starting node
/healthCheck the health of the server

Security Considerations

By default, the MCP server only listens on localhost for security reasons. If you need to expose it to other machines:

  1. Use the --host option to specify the interface to bind to
  2. Consider setting up authentication (see documentation)
  3. Use HTTPS for secure communication
  4. Consider using a reverse proxy like Nginx for additional security

Troubleshooting

Server Won’t Start

If the server won’t start, check:

  1. If another process is using the same port
  2. If you have permission to bind to the specified port
  3. If the database path is correct and accessible
  4. The logs for more detailed error information

Connection Issues

If clients can’t connect to the server:

  1. Check if the server is running with arc serve status
  2. Verify the host and port settings
  3. Check firewall settings
  4. Ensure the client is using the correct connection details

See Also