Skip to main content
Glama

Agent Context Hub

English | 简体中文

Agent Context Hub is a reusable MCP server for shared, versioned context across AI agents and devices. It is not tied to OpenClaw: Codex, Claude Code, Hermes, Cursor, OpenClaw, and any client that supports Streamable HTTP MCP can connect to the same workspace.

Not a personal workbench. Agent Context Hub is not a dashboard, task manager, chat UI, or a new agent. It is shared-context infrastructure: the private Workspace is the data and facts layer; Agent Context Hub is the access, synchronization, permission, and revision layer.

It keeps human-readable Markdown and YAML in a private GitHub workspace repository and exposes a small MCP interface. This public repository contains only server code, tests, documentation, and generic examples.

What it solves

  • Different agents and devices read the same current profile, rules, skills, and project state.

  • GitHub main stays the source of truth instead of chat history or opaque agent memory.

  • Each device has its own token and can be revoked independently.

  • Task closeouts write only allowed project-state files and reject stale concurrent updates.

Related MCP server: Graph

If this is your first real installation and use of Agent Context Hub, do not treat templates/agent-context-workspace as your real Workspace and do not put personal data in the public repository. That directory is only a public starter template / local smoke-test dataset.

If you are using Codex, Claude Code, Hermes, OpenClaw, or another execution-capable Agent, the simplest entry point is to give it this repository and say:

Help me install and use this project for the first time:
https://github.com/zyplong/agent-context-hub

The Agent should interpret this as a real first-time setup, read prompts/00-master-setup-wizard.md, and then proceed phase by phase: environment check → private Workspace → profile prefill → onboarding → Hub → private networking → Device Token → client configuration → MCP registration → first read-only test → cross-Agent synchronization test.

If a local checkout of this repository already exists, the Agent should verify and reuse it instead of cloning another copy. Real personal data belongs only in your own private Workspace repository.

For manual setup, continue with Quick start.

Resource boundary

Agent Context Hub manages shared operational context, not a general-purpose RAG knowledge base. It may keep lightweight metadata about important external resources so a new agent knows what exists, why it matters, where it lives, and whether the current client can access it.

The bundled workspace template includes resources/RESOURCE_REGISTRY.yaml for this purpose. Store references and concise summaries there, not full PDFs, document chunks, embeddings, datasets, credentials, or signed download URLs.

When a required resource is unavailable, the agent should report that the current context is insufficient and ask the user to upload the resource, grant access to its existing location, or use an external retrieval/RAG system that owns it.

See Resource boundary | 资源边界(中文).

MCP tools

Tool

Purpose

context_routes

Discover projects, aliases, and routes.

context_bootstrap

Load minimal task context and return a workspace revision.

context_query

Search selected workspace scopes with source paths.

context_closeout

Write an evidence-backed closeout to approved files.

context_review_candidate

Accept, reject, or supersede one pending candidate without auto-promoting it to formal state.

Client support status

The server is protocol-compatible with Streamable HTTP MCP clients. Protocol compatibility does not automatically mean that every client has completed live integration testing.

Client

Status

OpenClaw

Configuration documented; live validation should still be recorded per release.

Codex

Protocol compatible; live integration validation pending unless documented in the validation report.

Hermes

Protocol compatible; live integration validation pending unless documented in the validation report.

Claude Code

Protocol compatible; live integration validation pending unless documented in the validation report.

Use the real multi-device validation guide before describing a client or device path as live validated.

Local demo / developer smoke test

The following path only verifies the code, dependencies, and local stdio MCP reads. It is not the real first-time setup flow, and you should not put personal data into the example Workspace.

git clone https://github.com/YOUR_ACCOUNT/agent-context-hub.git
cd agent-context-hub
npm install
npm test

export PERSONAL_CONTEXT_WORKSPACE="$PWD/templates/agent-context-workspace"
npm run dev

This connects the stdio MCP server to the public example Workspace for demo / smoke testing. Passing this test does not mean that a private Workspace, remote Hub, cross-device path, or cross-Agent synchronization has been deployed.

For real use, return to “First real setup” above or read Quick start | 快速开始(中文).

Create your private workspace

Use templates/agent-context-workspace as the starter for a new private GitHub repository. Replace the sample profile, rules, projects, route map, and resource registry with your own information.

Never publish that workspace. Do not put tokens, private keys, passwords, personal documents, or chat transcripts in it.

context-map.yaml is the important control file. It declares exactly which files a route can read and which project files a closeout may write.

common:
  always_read:
    - profile/RESPONSE_PREFERENCES.md
    - rules/EVIDENCE_POLICY.md
    - resources/RESOURCE_REGISTRY.yaml

routes:
  sample_project_code:
    project_id: sample-project
    aliases: [sample-project, Sample Project]
    task_aliases: [code, fix, review]
    read:
      - projects/sample-project/CURRENT_STATE.yaml
      - projects/sample-project/NEXT_ACTIONS.md
    write:
      - projects/sample-project/CURRENT_STATE.yaml
      - projects/sample-project/NEXT_ACTIONS.md

Remote deployment

For cross-device use, run the HTTP server on one trusted machine or server and connect clients through HTTPS.

The server reads GitHub through a GitHub App installed only on the private workspace repository. The app needs Contents: Read and write only if you enable context_closeout.

cp .env.example .env
# Fill in your own GitHub App and device-token values. Never commit .env.
npm run build
npm run http:start

Task lifecycle

  1. The agent calls context_routes if it does not know the available routes.

  2. The agent calls context_bootstrap before work and saves workspaceRevision.

  3. The agent checks whether the returned context is sufficient for the task. If a required external resource is missing or inaccessible, it asks for that resource instead of inventing content.

  4. The agent performs the task.

  5. On completion, pause, or block, it calls context_closeout with that revision, a factual summary, evidence, and next actions.

  6. The server checks the allowlist and concurrency, writes a Git commit, then returns the revision and commit URL.

  7. Unverified observations can be stored as candidates. context_review_candidate may mark them accepted, rejected, or superseded.

  8. Accepted does not mean formal state was updated. An accepted candidate only becomes eligible for a later evidence-backed formal update through a fresh bootstrap and closeout.

Agents should not upload full conversations or source documents into the Hub. Only concise, evidence-backed project state and lightweight resource metadata belong in the workspace.

Verify

npm test
npm run typecheck
npm run build

License

MIT

Available Tools

4 tools
context_bootstrapBootstrap personal contextA
Read-onlyIdempotent

Load current personal context for a task. Omit project_hint to read common identity and rules only; use route_hint when a project has multiple task-specific routes.

ParametersJSON Schema
NameRequiredDescriptionDefault
taskYes
max_charsNo
route_hintNo
project_hintNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only and idempotent behavior, so the description doesn't need safety disclosure. It adds valuable behavioral nuance about how output scope changes based on project_hint and route_hint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the primary action, and no unnecessary words. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple read-only tool with strong annotations and a small parameter set, the description covers essential usage logic. It could mention return format or when to prefer context_query, but it is adequate for the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description explains the semantics of project_hint and route_hint, which is helpful. However, max_chars and task are not addressed, though task is self-explanatory and max_chars has schema constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool loads current personal context for a task with a specific verb and resource. It references project and route hints, which hints at differentiation, but doesn't explicitly compare to sibling tools like context_query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear conditional guidance: omit project_hint for common identity and rules, use route_hint for multiple task-specific routes. It doesn't explicitly name alternatives or exclusion criteria, but the usage context is well implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

context_closeoutSynchronize completed project contextB

Compress a completed, paused, or blocked task into evidence-backed project state and synchronize only files explicitly allowed by the route write policy.

ParametersJSON Schema
NameRequiredDescriptionDefault
statusYes
summaryYes
evidenceYes
route_hintNo
next_actionsYes
project_hintYes
base_revisionYes

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds some behavioral context beyond the annotations by noting that synchronization is limited to files allowed by the route write policy, which is useful for safety. However, with all annotations false, it doesn't disclose whether the operation is reversible, what happens to existing state, or failure conditions, leaving significant gaps for a write operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, dense sentence that front-loads the primary action and key constraint. Every phrase earns its place, with no repetition or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 7 parameters, no output schema, and sparse annotations, yet the description provides only minimal guidance on how to invoke it. It lacks explanations of parameter values, return behavior, or edge cases, making it insufficiently complete for such a complex tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate, but it only hints at the purpose of `evidence` ('evidence-backed') and `route_hint` ('route write policy'). The core parameters (project_hint, base_revision, summary, status, next_actions) are left undefined, leaving the agent to guess their exact meaning and format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('compress' a task into evidence-backed project state) and a resource (completed/paused/blocked tasks), which clearly distinguishes it from sibling tools like query or bootstrap. However, it doesn't explicitly name alternatives or elaborate on what 'compress' entails, leaving some ambiguity about its exact scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool by specifying task statuses ('completed, paused, or blocked') and mentioning the route write policy, but it gives no explicit guidance on when not to use it or which sibling tool to prefer. The context is clear but lacks exclusions or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

context_queryQuery personal contextA
Read-onlyIdempotent

Search the current personal context within explicit scopes and return traceable source excerpts.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
scopesNo
max_charsNo

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already mark the tool as read-only, idempotent, non-destructive, and closed-world. The description adds valuable behavioral context by mentioning 'explicit scopes' and 'traceable source excerpts', which describe scoping behavior and result traceability. It does not contradict the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that immediately states the action ('Search') and follows with the target and output. Every word contributes to the tool's purpose without wasted phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and only minimal parameter descriptions, the description provides a high-level view of the tool but lacks detailed behavioral information such as result format, handling of missing scopes, or the effect of max_chars. For a moderately complex tool with 3 parameters and no schema descriptions, this is a clear gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage for its 3 parameters, so the description must compensate. It only adds meaning for the 'scopes' parameter via 'within explicit scopes', but leaves 'query' and 'max_chars' unexplored. The search term behavior and character limit are not mentioned, making the description insufficient for parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Search' with a precise resource 'current personal context within explicit scopes' and specifies output 'traceable source excerpts'. This clearly distinguishes it from sibling tools like context_bootstrap, context_closeout, and context_routes, which imply different operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by stating it searches personal context, but it does not explicitly specify when to use this tool over alternatives or mention any exclusions. For example, it doesn't say 'use context_routes for route planning' or 'use this when scoping is needed'. Thus usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

context_routesDiscover personal context routesA
Read-onlyIdempotent

List canonical project IDs, exact aliases, task aliases, and route names before choosing project_hint or route_hint.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the tool as read-only, idempotent, and non-destructive, so the description only needs to add meaningful context. It does so by specifying exactly what the tool lists (canonical project IDs, aliases, task aliases, route names), which is behaviorally useful for an agent. There is no contradiction with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that wastes no words. It conveys the action, the output contents, and the intended usage context in a compact, readable form.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (no parameters, no output schema) and the strong annotations, the description is complete enough. It explains what will be returned and when to call the tool, which is all an agent needs to invoke it correctly alongside sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters, the schema is empty and the description cannot meaningfully elaborate on parameter semantics. The baseline for no-parameter tools is 4, and the description sufficiently clarifies that this is a simple list/discovery operation with no input requirements.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'List' and clearly identifies the resource: canonical project IDs, exact aliases, task aliases, and route names. It also frames the tool as a prerequisite step ('before choosing project_hint or route_hint'), which distinguishes it from sibling tools like context_query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('before choosing project_hint or route_hint'), giving clear contextual timing. It does not, however, mention when not to use it or name alternative tools, so it stops short of the full 'when-not/alternatives' guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedcontext_bootstrap
    • First observedcontext_closeout
    • First observedcontext_query
    • First observedcontext_routes

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct phase of context management: bootstrap loads, closeout writes/compresses, routes lists available routes, and query searches. There is no functional overlap or ambiguity about which tool to use.

Naming Consistency4/5

All tools share the 'context_' prefix, with a brief term following. However, 'routes' is a noun while the others are verbs, creating a slight mismatch, yet the pattern remains predictable and readable.

Tool Count5/5

Four tools is a well-scoped set for a context management server. Each tool earns its place and covers a core operation without unnecessary additions.

Completeness5/5

The tools cover the full lifecycle: discovering available routes, bootstrapping context, querying during a task, and closing out with state compression. No obvious gaps or dead ends exist for the server's purpose.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    A local-first MCP server that snapshots project working state into a structured context object, enabling agents to share and resume sessions seamlessly without leaving your machine.
    5
    4
    Apache 2.0

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/zyplong/agent-context-hub'

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