diff --git a/configs/copilot/README.md b/configs/copilot/README.md new file mode 100644 index 0000000..ca86d1a --- /dev/null +++ b/configs/copilot/README.md @@ -0,0 +1,27 @@ +# GitHub Copilot & VS Code MCP Configuration Snippets + +Ready-to-adapt MCP server configurations for [EbbMem](https://ebbmem.ai) in Visual Studio Code and the GitHub Copilot cloud agent / code review. + +> **Untested live notice:** Placeholder URLs (`https://ebbmem.example.com`) are used throughout. Live testing against a deployed public HTTPS endpoint and Copilot cloud sandbox is tracked as a follow-up. No GitHub MCP Registry submission has been made. + +## Files + +| File | Target | Auth Mode | +| --- | --- | --- | +| [`vscode.mcp.json`](./vscode.mcp.json) | `.vscode/mcp.json` (VS Code workspace) | `X-API-Key` header via `${input:ebbmem_api_key}` prompt | +| [`vscode-oauth.mcp.json`](./vscode-oauth.mcp.json) | `.vscode/mcp.json` (VS Code workspace) | OAuth 2.1 (RFC 9728 discovery) | +| [`copilot-cloud-agent.mcp.json`](./copilot-cloud-agent.mcp.json) | GitHub repo Copilot coding agent settings (`mcpServers`) | `Authorization: Bearer $COPILOT_MCP_EBBMEM_API_KEY` | + +## Copilot Cloud Agent & Code Review Requirements + +1. **Repository settings placement:** Paste the contents of [`copilot-cloud-agent.mcp.json`](./copilot-cloud-agent.mcp.json) into **Repository Settings -> Copilot -> Coding agent -> MCP configuration** on GitHub.com (uses top-level `mcpServers`, unlike VS Code's `.vscode/mcp.json` `servers` key). +2. **`COPILOT_MCP_` secret prefix:** Create an agent secret in repository or environment settings whose name starts with `COPILOT_MCP_` (for example `COPILOT_MCP_EBBMEM_API_KEY`). Reference it via `$COPILOT_MCP_EBBMEM_API_KEY` inside `headers`. Never embed raw keys or query-string credentials (`?token=`, `?api_key=`). +3. **Tools allowlist (`core` tools only):** The snippet restricts `"tools"` to the six `/mcp/core` tools (`memory_remember`, `memory_recall`, `memory_reinforce`, `memory_forget`, `memory_context_pack`, `memory_status`), preventing access to `/mcp/admin` tools (`memory_dream`, `memory_reflect`, `memory_purge`). +4. **Tools only, no OAuth:** Copilot cloud agent consumes MCP **tools only** (not MCP resources or prompts) and does **not** support interactive OAuth flows — use an API-key header backed by a `COPILOT_MCP_` secret. +5. **Organization / enterprise policy:** An administrator must enable **`MCP servers in Copilot`** (`Organization Settings -> Copilot -> Policies` or `Enterprise AI controls -> MCP`) before Copilot clients or cloud agents can connect. Once enabled on a repository, Copilot cloud agent and code review execute allowlisted MCP tools autonomously without per-call human confirmation. +6. **GitHub MCP Registry:** Listing EbbMem in the GitHub MCP Registry requires explicit approval and is not included here. + +## References + +- [VS Code & GitHub Copilot Quickstart](../../docs/integrations/hosts/vscode-copilot.md) +- [Agent Instruction Pack](../../instructions/README.md) diff --git a/configs/copilot/copilot-cloud-agent.mcp.json b/configs/copilot/copilot-cloud-agent.mcp.json new file mode 100644 index 0000000..34e81dd --- /dev/null +++ b/configs/copilot/copilot-cloud-agent.mcp.json @@ -0,0 +1,20 @@ +{ + "mcpServers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core", + "headers": { + "Authorization": "Bearer $COPILOT_MCP_EBBMEM_API_KEY", + "X-Ebb-Namespace": "acme:u:alice" + }, + "tools": [ + "memory_remember", + "memory_recall", + "memory_reinforce", + "memory_forget", + "memory_context_pack", + "memory_status" + ] + } + } +} diff --git a/configs/copilot/vscode-oauth.mcp.json b/configs/copilot/vscode-oauth.mcp.json new file mode 100644 index 0000000..d78e1fe --- /dev/null +++ b/configs/copilot/vscode-oauth.mcp.json @@ -0,0 +1,8 @@ +{ + "servers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core" + } + } +} diff --git a/configs/copilot/vscode.mcp.json b/configs/copilot/vscode.mcp.json new file mode 100644 index 0000000..a5a4a3d --- /dev/null +++ b/configs/copilot/vscode.mcp.json @@ -0,0 +1,20 @@ +{ + "servers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core", + "headers": { + "X-API-Key": "${input:ebbmem_api_key}", + "X-Ebb-Namespace": "acme:u:alice" + } + } + }, + "inputs": [ + { + "type": "promptString", + "id": "ebbmem_api_key", + "description": "EbbMem API key (sent via X-API-Key header)", + "password": true + } + ] +} diff --git a/docs/integrations/hosts/README.md b/docs/integrations/hosts/README.md new file mode 100644 index 0000000..06d98f8 --- /dev/null +++ b/docs/integrations/hosts/README.md @@ -0,0 +1,29 @@ +# Host MCP Quickstarts + +Remote [Streamable HTTP](https://modelcontextprotocol.io) quickstarts for connecting coding assistants and desktop clients to [EbbMem](https://ebbmem.ai). + +> **Note:** Snippets in this directory use placeholder URLs (`https://ebbmem.example.com`) and have **not** been tested live against a public hosted endpoint yet. Live end-to-end verification is tracked as a follow-up once a reachable HTTPS deployment is available. + +## Available Host Guides + +| Host | Auth Variants | Guide | +| --- | --- | --- | +| **VS Code + GitHub Copilot** | OAuth 2.1, API key (`inputs`), Copilot cloud agent (`COPILOT_MCP_`) | [vscode-copilot.md](./vscode-copilot.md) | +| **Claude Code + Claude Desktop** | OAuth 2.1, API key (`--header` / stdio bridge) | [claude.md](./claude.md) | +| **Cursor** | OAuth 2.1, API key (`headers`), install deeplink | [cursor.md](./cursor.md) | + +## MCP Endpoint Profiles & Security Rules + +- **Endpoint profiles:** + - `/mcp/core` (**recommended default**): 6 core tools (`memory_remember`, `memory_recall`, `memory_reinforce`, `memory_forget`, `memory_context_pack`, `memory_status`). + - `/mcp/full`: 15 tools, adding `memory_search` / `memory_get` aliases, episodic timeline tools, and association/introspection tools. + - `/mcp/admin`: 18 tools, adding admin-gated maintenance tools (`memory_dream`, `memory_reflect`, `memory_purge`). +- **Header-only credentials:** Send keys and bearer tokens strictly in `Authorization: Bearer ` or `X-API-Key` headers, never in URL query strings. +- **Cognitive discipline:** `memory_recall` is strictly read-only. Memories decay over time unless reinforced; call `memory_reinforce` only for memories actually used in an answer or action, keeping `injected` (reinforce-all-shown) OFF by default. + +## References + +- [Repository Overview](../../../README.md) +- [Agent Instruction Pack](../../../instructions/README.md) +- [GitHub Copilot Config Snippets](../../../configs/copilot/README.md) +- [Conformance Kit](../../../conformance/README.md) diff --git a/docs/integrations/hosts/claude.md b/docs/integrations/hosts/claude.md new file mode 100644 index 0000000..1f70f6c --- /dev/null +++ b/docs/integrations/hosts/claude.md @@ -0,0 +1,118 @@ +# Claude Code and Claude Desktop Integration Quickstart + +Connect **Claude Code** (CLI / IDE) and **Claude Desktop** to [EbbMem](https://ebbmem.ai) over remote Streamable HTTP (`/mcp/core`), enabling read-only `recall`, secret-redacted `remember`, and explicit post-use `reinforce`. + +> **Untested live notice:** All snippets below use placeholder URLs (`https://ebbmem.example.com`) and are derived from current Anthropic Claude Code and Claude Desktop documentation. Live end-to-end verification against a deployed public HTTPS endpoint is pending as a follow-up. + +## What You Need + +- **EbbMem endpoint:** A reachable EbbMem Streamable HTTP URL such as `https://ebbmem.example.com/mcp/core` (6 core tools — recommended default), `/mcp/full` (15 tools, adding `memory_search` / `memory_get` aliases and episodic/association tools), or `/mcp/admin` (18 tools, admin-gated). +- **Authentication:** + - **OAuth 2.1:** Supported natively by Claude Code (`/mcp` auth flow) and Claude Desktop Custom Connectors over public HTTPS (port 443). + - **API key (header-only):** `X-API-Key` or `Authorization: Bearer `. Never place credentials in URL query parameters. +- **Namespace:** Target namespace such as `acme:u:alice` via `X-Ebb-Namespace` (avoid per-thread or per-turn namespaces). +- **Agent skill (recommended):** Copy [`instructions/claude-code/SKILL.md`](../../../instructions/claude-code/SKILL.md) to `.claude/skills/ebbmem/SKILL.md`, or install the local plugin bundle in `plugins/claude-code/` once available. + +## Config Snippet + +### Option A: Claude Code CLI — OAuth 2.1 + +Register the remote HTTP server without static headers and authenticate via `/mcp` inside Claude Code: + +```bash +claude mcp add --transport http ebbmem https://ebbmem.example.com/mcp/core +``` + +Add `--scope project` to write a shareable `.mcp.json` file at your repository root: + +```bash +claude mcp add --scope project --transport http ebbmem https://ebbmem.example.com/mcp/core +``` + +Verify connection status with `claude mcp list` and run `/mcp` inside a session to complete OAuth sign-in. + +### Option B: Claude Code CLI — API Key (`--header`) + +Pass the API key and namespace strictly via HTTP headers: + +```bash +claude mcp add --transport http ebbmem https://ebbmem.example.com/mcp/core \ + --header "X-API-Key: ${EBBMEM_API_KEY}" \ + --header "X-Ebb-Namespace: acme:u:alice" +``` + +Equivalent project-scoped `.mcp.json`: + +```json +{ + "mcpServers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core", + "headers": { + "Authorization": "Bearer ${EBBMEM_API_KEY}", + "X-Ebb-Namespace": "acme:u:alice" + } + } + } +} +``` + +### Option C: Claude Desktop — Native Custom Connector (OAuth 2.1) + +For publicly reachable HTTPS EbbMem servers (port `443`, reachable from Anthropic's connector infrastructure): + +1. Open **Claude Desktop -> Settings -> Connectors** (or **Customize -> Connectors**). +2. Click **Add custom connector**. +3. Enter your server URL (`https://ebbmem.example.com/mcp/core`). +4. Optionally expand **Advanced settings** to supply an OAuth Client ID / Secret if your authorization server requires pre-registered credentials. +5. Click **Add**, then **Connect** to complete OAuth authorization. + +### Option D: Claude Desktop — Local Bridge (`claude_desktop_config.json`, API Key) + +If your server uses API-key headers rather than OAuth or is only reachable locally, bridge stdio to Streamable HTTP via `mcp-remote` in `claude_desktop_config.json` (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, `%APPDATA%\Claude\claude_desktop_config.json` on Windows; requires Node.js 18+): + +```json +{ + "mcpServers": { + "ebbmem": { + "command": "npx", + "args": [ + "-y", + "mcp-remote", + "https://ebbmem.example.com/mcp/core", + "--header", + "X-API-Key: ${EBBMEM_API_KEY}", + "--header", + "X-Ebb-Namespace: acme:u:alice" + ] + } + } +} +``` + +Fully quit and restart Claude Desktop after editing `claude_desktop_config.json`. + +> **Tip:** If you want automatic session-start recall, stop-time capture/reinforcement hooks, and the EbbMem skill bundled together for Claude Code, use the plugin package under `plugins/claude-code/`. + +## First Memory in Under Five Steps + +1. **Connect EbbMem:** Run `claude mcp add --transport http ...` (Claude Code) or add the Custom Connector / config block (Claude Desktop), and verify the server shows connected in `claude mcp list` or Connectors settings. +2. **Install the skill:** Place [`instructions/claude-code/SKILL.md`](../../../instructions/claude-code/SKILL.md) in `.claude/skills/ebbmem/SKILL.md` so Claude follows EbbMem decay and redaction rules. +3. **Remember a durable fact:** Ask Claude to remember a workspace decision or user preference with `memory_remember` (`tier: "semantic"`, never storing secrets or API keys). +4. **Recall before answering:** Start a new session and ask about that decision; confirm `memory_recall` retrieves it without mutating storage strength. +5. **Reinforce used memories:** Confirm Claude calls `memory_reinforce` (`memory_id`, `used_ids`, and `recall_id` when returned) only for memories actually used in the answer, keeping `injected` OFF. + +## Troubleshooting + +- **`400 Bad Request` on URL credentials:** Move any `token` or `api_key` out of the URL query string into `--header` / `headers` or OAuth bearer tokens. +- **Claude Desktop Custom Connector cannot reach the server:** Custom Connectors require a publicly reachable HTTPS endpoint on port `443` (not `127.0.0.1` or an internal VPN). Use Option D (`claude_desktop_config.json`) for local or header-key setups. +- **`claude mcp list` fails to authenticate:** Run `/mcp` inside an active Claude Code session to refresh OAuth login, or confirm `${EBBMEM_API_KEY}` is exported in the shell environment before starting Claude Code. +- **`404 Not Found` on namespace operations:** EbbMem returns `404` for unauthorized or non-existent namespaces; confirm `X-Ebb-Namespace` matches your credential scope. + +## References + +- [Host MCP Quickstarts](./README.md) +- [Claude Code Instruction Wrapper](../../../instructions/claude-code/SKILL.md) +- [Agent Instruction Pack](../../../instructions/README.md) +- [Conformance Kit](../../../conformance/README.md) diff --git a/docs/integrations/hosts/cursor.md b/docs/integrations/hosts/cursor.md new file mode 100644 index 0000000..14c05ae --- /dev/null +++ b/docs/integrations/hosts/cursor.md @@ -0,0 +1,96 @@ +# Cursor Integration Quickstart + +Connect **Cursor** to [EbbMem](https://ebbmem.ai) over remote Streamable HTTP (`/mcp/core`), pairing MCP tools with the Cursor rule in [`instructions/cursor/ebbmem.mdc`](../../../instructions/cursor/ebbmem.mdc) for read-only `recall`, secret-redacted `remember`, and explicit post-use `reinforce`. + +> **Untested live notice:** All snippets and deeplinks below use placeholder URLs (`https://ebbmem.example.com`) and are derived from current Cursor documentation. Live end-to-end verification against a deployed public HTTPS endpoint is pending as a follow-up. + +## What You Need + +- **EbbMem endpoint:** A reachable EbbMem Streamable HTTP endpoint such as `https://ebbmem.example.com/mcp/core` (6 core tools — recommended default), `/mcp/full` (15 tools, adding `memory_search` / `memory_get` aliases and episodic/association tools), or `/mcp/admin` (18 tools, admin-gated). +- **Authentication:** + - **OAuth 2.1:** Cursor discovers OAuth metadata via RFC 9728 (`WWW-Authenticate`) and opens a browser sign-in flow. + - **API key (header-only):** `X-API-Key` or `Authorization: Bearer ` in `.cursor/mcp.json` `headers` (never in URL query parameters). +- **Namespace:** Target namespace such as `acme:u:alice` via `X-Ebb-Namespace` (avoid per-thread or per-turn namespaces). +- **Cursor rules:** Copy [`instructions/cursor/ebbmem.mdc`](../../../instructions/cursor/ebbmem.mdc) to `.cursor/rules/ebbmem.mdc` (or use the Cursor plugin package in `plugins/cursor/`). + +## Config Snippet + +Cursor reads MCP servers from `.cursor/mcp.json` (project scope) or `~/.cursor/mcp.json` (user scope) using a top-level `"mcpServers"` object. + +### Option A: Cursor `mcp.json` — OAuth 2.1 + +```json +{ + "mcpServers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core" + } + } +} +``` + +#### One-Click Install Deeplink (OAuth 2.1) + +Cursor deeplinks follow `cursor://anysphere.cursor-deeplink/mcp/install?name=&config=`: + +```text +cursor://anysphere.cursor-deeplink/mcp/install?name=ebbmem&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vZWJibWVtLmV4YW1wbGUuY29tL21jcC9jb3JlIn0%3D +``` + +Decoded `config` payload: `{"type":"http","url":"https://ebbmem.example.com/mcp/core"}`. + +### Option B: Cursor `mcp.json` — API Key (`headers`) + +```json +{ + "mcpServers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core", + "headers": { + "X-API-Key": "${env:EBBMEM_API_KEY}", + "X-Ebb-Namespace": "acme:u:alice" + } + } + } +} +``` + +#### One-Click Install Deeplink (API Key) + +```text +cursor://anysphere.cursor-deeplink/mcp/install?name=ebbmem&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vZWJibWVtLmV4YW1wbGUuY29tL21jcC9jb3JlIiwiaGVhZGVycyI6eyJYLUFQSS1LZXkiOiIke2VudjpFQkJNRU1fQVBJX0tFWX0iLCJYLUViYi1OYW1lc3BhY2UiOiJhY21lOnU6YWxpY2UifX0%3D +``` + +To generate a deeplink for your own host URL in Node.js or Python: + +```bash +python -c 'import base64, json, urllib.parse; cfg = {"type": "http", "url": "https://ebbmem.example.com/mcp/core"}; b64 = base64.b64encode(json.dumps(cfg, separators=(",", ":")).encode()).decode(); print(f"cursor://anysphere.cursor-deeplink/mcp/install?name=ebbmem&config={urllib.parse.quote(b64, safe=\"\")}")' +``` + +### Add the Cursor Rule (`.cursor/rules/ebbmem.mdc`) + +Copy [`instructions/cursor/ebbmem.mdc`](../../../instructions/cursor/ebbmem.mdc) into `.cursor/rules/ebbmem.mdc` in your project so Cursor Agent automatically recalls before answering, treats recalled text as untrusted data, redacts secrets, and reinforces only actually-used memories. + +## First Memory in Under Five Steps + +1. **Install the MCP server:** Click the Cursor deeplink above or save `.cursor/mcp.json`, then enable **ebbmem** in **Cursor Settings -> Tools & MCP**. +2. **Complete authentication:** Sign in via the OAuth prompt (Option A) or ensure `EBBMEM_API_KEY` is exported in your environment (Option B). +3. **Load the rule:** Confirm `.cursor/rules/ebbmem.mdc` appears active in **Cursor Settings -> Rules**. +4. **Store and recall:** Ask Cursor Agent to save a project preference with `memory_remember` (`tier: "semantic"`), then ask about it in a new Composer/Agent chat to trigger `memory_recall`. +5. **Verify reinforcement:** Confirm Cursor Agent calls `memory_reinforce` (`memory_id`, `used_ids`, and `recall_id` when returned) only on memories used in the answer, keeping `injected` OFF. + +## Troubleshooting + +- **`400 Bad Request` on URL credentials:** Never embed `?token=` or `?api_key=` in the `url` field; use `headers` or OAuth. +- **Deeplink fails to prompt:** Verify the `config` query parameter is valid Base64-encoded JSON (`type`, `url`, optional `headers`) and properly URL-encoded (`%3D` for `=`). +- **Rule not applied:** Ensure `.cursor/rules/ebbmem.mdc` retains its YAML frontmatter (`alwaysApply: true`). +- **`404 Not Found` on namespace calls:** Confirm `X-Ebb-Namespace` matches a namespace accessible to your credential. + +## References + +- [Host MCP Quickstarts](./README.md) +- [Cursor Instruction Rule](../../../instructions/cursor/ebbmem.mdc) +- [Agent Instruction Pack](../../../instructions/README.md) +- [Conformance Kit](../../../conformance/README.md) diff --git a/docs/integrations/hosts/vscode-copilot.md b/docs/integrations/hosts/vscode-copilot.md new file mode 100644 index 0000000..9558fbf --- /dev/null +++ b/docs/integrations/hosts/vscode-copilot.md @@ -0,0 +1,144 @@ +# VS Code and GitHub Copilot Integration Quickstart + +Connect Visual Studio Code (Agent Mode / Copilot Chat) and the GitHub Copilot cloud agent to [EbbMem](https://ebbmem.ai) over remote Streamable HTTP (`/mcp/core`), enabling read-only `recall`, secret-redacted `remember`, and explicit post-use `reinforce`. + +> **Untested live notice:** All snippets below use placeholder URLs (`https://ebbmem.example.com`) and are derived from current VS Code and GitHub Copilot documentation. Live end-to-end verification against a deployed public HTTPS endpoint is pending as a follow-up. + +## What You Need + +- **EbbMem endpoint:** A reachable EbbMem Streamable HTTP endpoint such as `https://ebbmem.example.com/mcp/core` (or `http://127.0.0.1:8320/mcp/core` for local self-hosting). + - Use `/mcp/core` (6 core tools) for everyday coding, `/mcp/full` (15 tools, including `memory_search` / `memory_get` aliases and episodic/association tools) when broader inspection is needed, or `/mcp/admin` (18 tools) only with admin-scoped credentials. +- **Authentication:** + - **VS Code (IDE):** Supports **OAuth 2.1** (RFC 9728 Protected Resource Metadata discovery + Client ID Metadata Documents) or **API-key headers** (`X-API-Key` / `Authorization: Bearer `) prompted via VS Code `inputs`. + - **GitHub Copilot cloud agent & code review:** Supports **API-key headers only** via `COPILOT_MCP_` repository secrets (no OAuth flow in cloud sandboxes). +- **Namespace:** Target namespace such as `acme:u:alice` passed via `X-Ebb-Namespace` (avoid per-thread or per-turn namespaces). +- **Target environment:** Visual Studio Code with GitHub Copilot Chat enabled; for Copilot cloud agent, repository admin access and the organization/enterprise `"MCP servers in Copilot"` policy enabled. +- **Optional agent instructions:** Copy [`instructions/AGENTS.md`](../../../instructions/AGENTS.md) or [`instructions/CORE.md`](../../../instructions/CORE.md) into your repository so the agent knows to reinforce only actually-used memories. + +## Config Snippet + +Ready-to-copy JSON files are also stored under [`configs/copilot/`](../../../configs/copilot/README.md). + +### Option A: VS Code `.vscode/mcp.json` — API Key (with Secure Input Prompt) + +VS Code workspace MCP configurations use `"servers"` at the top level and `"type": "http"`. Using `"inputs"` with `"password": true` keeps API keys out of git: + +```json +{ + "servers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core", + "headers": { + "X-API-Key": "${input:ebbmem_api_key}", + "X-Ebb-Namespace": "acme:u:alice" + } + } + }, + "inputs": [ + { + "type": "promptString", + "id": "ebbmem_api_key", + "description": "EbbMem API key (sent via X-API-Key header)", + "password": true + } + ] +} +``` + +See [`configs/copilot/vscode.mcp.json`](../../../configs/copilot/vscode.mcp.json). + +### Option B: VS Code `.vscode/mcp.json` — OAuth 2.1 + +When your EbbMem server has OAuth 2.1 enabled on `/mcp`, omit static credential headers and let VS Code discover authorization metadata via RFC 9728 `WWW-Authenticate`: + +```json +{ + "servers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core" + } + } +} +``` + +See [`configs/copilot/vscode-oauth.mcp.json`](../../../configs/copilot/vscode-oauth.mcp.json). + +### VS Code One-Click Install Links + +VS Code supports `vscode:mcp/install?` (or `vscode-insiders:mcp/install?...`) and the GitHub-safe HTTPS redirect wrapper `https://vscode.dev/redirect?url=...`: + +```text +vscode:mcp/install?%7B%22name%22%3A%22ebbmem%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Febbmem.example.com%2Fmcp%2Fcore%22%7D +``` + +Web/Markdown-safe redirect form: + +```markdown +[Install EbbMem in VS Code](https://vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522ebbmem%2522%252C%2522type%2522%253A%2522http%2522%252C%2522url%2522%253A%2522https%253A%252F%252Febbmem.example.com%252Fmcp%252Fcore%2522%257D) +``` + +> VS Code always opens a confirmation view displaying the server configuration before installing. + +### Option C: GitHub Copilot Cloud Agent & Code Review (Repository Settings) + +GitHub Copilot cloud agent and code review use a top-level `"mcpServers"` object configured in **Repository Settings -> Copilot -> Coding agent** on GitHub.com. Key constraints for Copilot cloud agent: + +- **Tools only, no OAuth:** The cloud agent only consumes MCP tools (no MCP resources or prompts) and does not perform interactive OAuth flows. +- **Secret prefix:** Store your API key in GitHub repository/environment agent secrets with the mandatory `COPILOT_MCP_` prefix (for example `COPILOT_MCP_EBBMEM_API_KEY`). +- **Least-privilege allowlist:** Restrict `"tools"` explicitly to the six `core` tools rather than `"*"`. + +```json +{ + "mcpServers": { + "ebbmem": { + "type": "http", + "url": "https://ebbmem.example.com/mcp/core", + "headers": { + "Authorization": "Bearer $COPILOT_MCP_EBBMEM_API_KEY", + "X-Ebb-Namespace": "acme:u:alice" + }, + "tools": [ + "memory_remember", + "memory_recall", + "memory_reinforce", + "memory_forget", + "memory_context_pack", + "memory_status" + ] + } + } +} +``` + +See [`configs/copilot/copilot-cloud-agent.mcp.json`](../../../configs/copilot/copilot-cloud-agent.mcp.json) and [`configs/copilot/README.md`](../../../configs/copilot/README.md). + +#### Organization & Enterprise Policy Note + +- An organization or enterprise administrator must enable the **`MCP servers in Copilot`** policy (`Settings -> Copilot -> Policies` for organizations, or `AI controls -> MCP` for enterprises) before Copilot clients or cloud agents can connect to MCP servers. +- Administrators can also restrict endpoints via `allowedMcpServers` / `deniedMcpServers` in `managed-settings.json`, custom MCP registry enforcement, and Copilot custom firewall egress rules. +- Because the Copilot cloud agent invokes configured repository MCP tools autonomously without per-call interactive approval, keep the `tools` allowlist scoped to `/mcp/core` tools only. + +## First Memory in Under Five Steps + +1. **Add the EbbMem server:** Save `.vscode/mcp.json` (Option A or B) in your workspace and click **Start** in the MCP server editor lens (or open the Command Palette -> `MCP: List Servers`). +2. **Authenticate:** Complete the OAuth browser sign-in (Option B) or enter your API key when prompted by `${input:ebbmem_api_key}` (Option A). +3. **Store a durable memory:** In Copilot Chat (Agent mode), ask Copilot to remember a project convention or preference via `memory_remember` (`tier: "semantic"`, never storing secrets or tokens). +4. **Recall before answering:** In a new chat session, ask about that convention and confirm `memory_recall` retrieves it as reference data without altering storage strength. +5. **Reinforce used memories:** Verify the agent calls `memory_reinforce` (`memory_id`, `used_ids`, and `recall_id` when returned) only for memories that actually informed its answer, leaving `injected` mode OFF. + +## Troubleshooting + +- **`400 Bad Request` mentioning URL credentials:** Never append `?token=` or `?api_key=` to the `url`. Keep credentials in `headers` or OAuth bearer tokens. +- **`401 Unauthorized` in VS Code OAuth mode:** Confirm your EbbMem server serves `/.well-known/oauth-protected-resource` (RFC 9728) and check the VS Code MCP output channel. +- **Copilot cloud agent ignores the server:** Confirm the **`MCP servers in Copilot`** organization/enterprise policy is enabled, the secret name starts with `COPILOT_MCP_`, and the endpoint is reachable from GitHub's cloud sandbox over HTTPS. +- **`403` / `-32003` on admin tools:** `/mcp/core` intentionally excludes `memory_dream`, `memory_reflect`, and `memory_purge`. Use `/mcp/core` for agent workflows. +- **Memories decay despite frequent recalls:** `memory_recall` is read-only. Confirm your instructions prompt `memory_reinforce` on memories that were actually used. + +## References + +- [Host MCP Quickstarts](./README.md) +- [GitHub Copilot Config Snippets](../../../configs/copilot/README.md) +- [Agent Instruction Pack](../../../instructions/README.md) +- [Conformance Kit](../../../conformance/README.md)