Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
COSMOS_URLNoPointing at your own cosmos.https://cosmos.polarity-lab.com
COSMOS_MCP_KEYNopmk_... per-user key. Overrides cache.
COSMOS_USER_IDNoPolarity user id.
COSMOS_SYSTEM_KEYNoSingle-tenant mode. Sends X-System-Key instead of X-MCP-Key. Requires COSMOS_USER_ID. For self-hosters or testing before per-user keys are deployed.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
polarity_whoamiA

Returns the polarity user id and cosmos account info that this MCP key is bound to. Cheap connectivity test. Call this first if the user asks who you know them as.

polarity_exportA

Export the user's full personal knowledge graph (nodes + edges + counts) as JSON in polarity/v1 format. Use this when the user asks for a snapshot of their exocortex, wants their data, or asks to download their .polarity file. Returns the full graph; can be large.

polarity_get_graphA

Read the user's graph view. entity selects which projection: 'user' (the user's self-graph), 'cosmos' (the cosmos entity's view of them), or 'polarity' (the dyadic synchronization between the two). Use 'user' for general questions about what the user thinks, does, or knows. Use 'polarity' when comparing the user's self-image against the system's observation.

polarity_askA

Ask a natural-language question over the user's personal knowledge graph. Cosmos synthesizes an answer from relevant nodes and edges. Use this when the user wants context-aware reasoning rather than raw data. Returns answer text plus cited node/edge ids.

polarity_observeA

Single-fact write into the user's personal cosmos graph. Prefer polarity_capture_turn for whole exchanges; use polarity_observe only when one specific durable observation needs to land without the surrounding turn. Examples that warrant an inline call: the user states a hard rule, names a concrete preference, or corrects an assumption you had wrong. Avoid logging ephemeral chat or your own reasoning. source should identify your client (e.g. 'claude-code', 'cursor', 'claude-desktop'). kind defaults to 'observation'; use 'event' for things that happened, 'preference' for stated likes/dislikes.

polarity_record_eventB

Record a structured event in the user's graph. Convenience wrapper over polarity_observe with kind='event'. Use for things that happened at a point in time: a meeting, a shipped release, a flight, an incident.

polarity_record_preferenceA

Record a stated preference in the user's graph. Convenience wrapper over polarity_observe with kind='preference'. Use when the user expresses a like, dislike, opinion, or working-style rule that should persist across sessions.

polarity_capture_turnA

This is how the user's cosmos graph learns from this conversation. CALL THIS AT THE END OF EVERY SUBSTANTIVE USER/ASSISTANT EXCHANGE, without being asked. The user installed cosmos-mcp precisely so their agents would persist what they notice. If you finish a turn and do not call this, that turn is lost to every other agent the user works with tomorrow. Cosmos runs its own extractor on the text and decides what is durable — your job is to hand over the raw exchange, not to pre-filter. Pass the user's message in user_text and your own reply in assistant_text. Skip only for trivial single-word exchanges ("hi", "thanks") and explicit meta-discussion of the tool itself. source should identify your client (e.g. 'claude-code', 'claude-desktop', 'cursor', 'codex', 'zed'). Returns the node ids cosmos created. Cheap to call; the extractor returns zero items if nothing was worth holding, and that is a fine outcome.

polarity_dumpC

Write a short message tied to a location waypoint into the user's graph. PolarityGPS-style. Use only when the user is explicitly recording a place-anchored thought.

polarity_checkinA

Record that the user checked in at a waypoint. Triggers co-presence detection against other users' recent check-ins.

polarity_declareC

Declare future presence at a waypoint. chip is the time-window enum: next_30, next_hour, tonight, tomorrow_night.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/teampolarity/cosmos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server