Skip to main content

Documentation Index

Fetch the complete documentation index at: https://artemiscity.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The Artemis Agentic Memory Layer is a Model Context Protocol (MCP) server that exposes an Obsidian vault to agents over a small, authenticated REST API. It lets agents read, write, search, tag, and reorganize notes as a shared, versioned source of truth β€” the long-term memory bus for Artemis City. Use this integration when you want agents to:
  • Persist context, plans, or reflections across sessions.
  • Coordinate with other agents around a single knowledge store.
  • Read structured human-curated notes (instructions, personas, capability docs) at runtime.
  • Maintain a queryable graph of tasks, tags, and frontmatter metadata.
The Python-side client and trust-aware wrapper that calls this server are documented in Memory Integration. This page documents the MCP server itself: how to deploy it, how to configure it, and the endpoints it exposes.

How it fits

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   HTTPS + Bearer   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   Local REST   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Artemis agents  β”‚ ─────────────────▢ β”‚  Agentic Memory MCP  β”‚ ─────────────▢ β”‚ Obsidian vaultβ”‚
β”‚ (Python / LLM)  β”‚ ◀───────────────── β”‚       server         β”‚ ◀───────────── β”‚  + REST pluginβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   JSON responses   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
The MCP server is a thin translation layer. It accepts MCP-style tool invocations over HTTP, authenticates them against a shared key, and forwards them to the Obsidian Local REST API plugin running on the host vault.

Prerequisites

  • Node.js 18+ (or Docker) on the host running the MCP server.
  • Obsidian with the Local REST API community plugin installed and enabled.
  • An API key generated from the Local REST API plugin settings.
  • A second secret (MCP_API_KEY) that agents present when calling this server.

Configuration

The server reads configuration from environment variables (typically a .env file or the environment: block in docker-compose.yml).
VariableRequiredDefaultDescription
MCP_API_KEYYesβ€”Shared secret agents send as Authorization: Bearer <key>.
OBSIDIAN_BASE_URLYesβ€”URL of the Obsidian Local REST API (for example https://127.0.0.1:27124).
OBSIDIAN_API_KEYYesβ€”API key from the Obsidian Local REST API plugin.
PORTNo3000Port the MCP server listens on.
MCP_LOG_LEVELNoinfoOne of debug, info, warn, error.
The server exits on startup if MCP_API_KEY, OBSIDIAN_BASE_URL, or OBSIDIAN_API_KEY is missing.

OBSIDIAN_BASE_URL by environment

EnvironmentValue
MCP server on the host, Obsidian on the hosthttps://127.0.0.1:27124
MCP server in Docker, Obsidian on host (macOS / Windows)https://host.docker.internal:27124
MCP server in Docker, Obsidian on host (Linux)https://<host-ip>:27124 or use network_mode: host
Replace 27124 with the port shown in your Local REST API plugin settings.

Deployment

Use the bundled docker-compose.yml to build and run the server:
docker-compose up --build
The server is then reachable at http://localhost:3000 and forwards requests to your vault at OBSIDIAN_BASE_URL.

Local Node.js

npm install
npm run dev      # hot-reload, development
# or
npm run build && npm start   # production build

Health check

The server exposes an unauthenticated health endpoint:
curl http://localhost:3000/health
# {"status":"ok"}

Authentication

Every /api/* request must include the bearer token:
Authorization: Bearer <MCP_API_KEY>
Missing or mismatched tokens return 403 Forbidden. Combine this with Trust-Based Access Control on the client side so agent-level trust scores gate which operations are even attempted.

API endpoints

All endpoints are POST, accept application/json, and live under /api. Responses use a consistent envelope:
{ "success": true, "data": { ... } }
or, on failure:
{ "success": false, "error": "..." }
EndpointBody fieldsPurpose
/api/getContextpathRead the full content of a note.
/api/appendContextpath, contentAppend content to a note (creates it if missing).
/api/updateNotepath, contentReplace the entire body of a note.
/api/searchNotesqueryFull-text search across the vault.
/api/listNotes(none)List all note paths in the vault.
/api/deleteNotepathDelete a note.
/api/manageFrontmatterpath, key, valueUpsert a YAML frontmatter key.
/api/manageTagspath, tags[], action (add or remove)Add or remove tags.
/api/searchReplacepath, search, replaceIn-place search and replace in a note.

Example: read a note

curl -X POST http://localhost:3000/api/getContext \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MCP_API_KEY" \
  -d '{ "path": "Daily/2026-05-20.md" }'
{
  "success": true,
  "data": {
    "path": "Daily/2026-05-20.md",
    "content": "# Daily Notes\n\n- Reviewed agent reflections\n- ..."
  }
}

Example: append agent context

curl -X POST http://localhost:3000/api/appendContext \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MCP_API_KEY" \
  -d '{
        "path": "Agents/artemis/journal.md",
        "content": "\n- 2026-05-20: Completed reflection cycle."
      }'

Example: tag a note

curl -X POST http://localhost:3000/api/manageTags \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $MCP_API_KEY" \
  -d '{ "path": "Projects/atp.md", "tags": ["urgent", "review"], "action": "add" }'

Calling the server from Python

Most Artemis agents talk to the memory layer through the Python MemoryClient, which wraps these endpoints and adds trust enforcement:
from memory.integration import MemoryClient

client = MemoryClient(
    base_url="http://localhost:3000",
    api_key="your_mcp_api_key",
)

# Read a note
response = client.get_context("Daily/2026-05-20.md")
if response.success:
    print(response.data["content"])

# Persist a reflection
client.store_agent_context(
    "artemis",
    "Completed ATP integration successfully",
)
See Memory Integration for the full client surface, trust levels, and context-loading helpers.

Security considerations

  • Treat both keys as secrets. MCP_API_KEY grants full vault access via this server; OBSIDIAN_API_KEY grants direct vault access via the plugin.
  • Default binding is localhost. If you expose the server to a wider network, put it behind a firewall, reverse proxy, or mTLS.
  • Self-signed certificates. The server is configured to accept the plugin’s self-signed HTTPS cert (rejectUnauthorized: false). For production, terminate TLS at a trusted proxy.
  • Validate agent inputs. The server performs minimal validation. Sanitize paths and content on the client side, and combine with trust scoring before issuing write or delete operations.

Troubleshooting

SymptomLikely cause
Server exits on boot with … is not setA required env var is missing. Check .env or the compose environment: block.
ECONNREFUSED from the serverObsidian is closed, the Local REST API plugin is disabled, or OBSIDIAN_BASE_URL is wrong.
403 Forbidden: Invalid API KeyThe agent’s Authorization header does not match MCP_API_KEY.
Unauthorized from ObsidianOBSIDIAN_API_KEY is wrong or was rotated in the plugin settings.
Note operations failPath does not match the exact vault path (including the .md extension).
On Linux hosts running the MCP server in Docker, host.docker.internal does not resolve by default β€” use the host’s bridge IP (often 172.17.0.1) or set network_mode: host in compose.
Last modified on May 22, 2026