Skip to content

GitHub Copilot CLI

Add Alexein to GitHub Copilot CLI with one command, so it searches your memory and saves what it learns in every project. You sign in; there is no key.

GitHub Copilot CLI searches your Alexein memory before it answers, and saves what you tell it and what you build together.

For Copilot's agent mode in VS Code, see VS Code.

1. Add Alexein

Run this command:

Terminal
copilot mcp add --transport http alexein https://api.alexein.ai/v1/mcp

Start copilot, run /mcp, choose alexein and authenticate. Your browser opens Alexein's sign-in.

Sign in, keep Read and save so Copilot can save, and select Allow. There is no key to copy.

copilot mcp add saves the server in ~/.copilot/mcp-config.json, for you in every project. To disconnect, select Disconnect on it in My memory › AI assistants, or run copilot mcp remove alexein.

Or install the plugin

Alexein's plugin adds the same server for you:

Terminal
copilot plugin marketplace add Alexein-AI/copilot-plugin
copilot plugin install alexein-ai@alexein-ai

Then run /mcp in copilot and sign in, as above.

For scripts and CI: a key

Where nobody is there to sign in, use a personal key instead.

  1. Open My memory › Keys and select Create key. Label it Copilot CLI, choose Read and write so it can save, and copy the key. It is shown once.
  2. Put it in an environment variable, and add the server with it:
Terminal
export ALEXEIN_API_KEY="tm_..."

copilot mcp add --transport http \
  --header "Authorization: Bearer $ALEXEIN_API_KEY" \
  --header "X-Alexein-User: me" \
  alexein https://api.alexein.ai/v1/mcp

X-Alexein-User: me names your own memory. The shell fills in $ALEXEIN_API_KEY when you run the command, so the key is saved in ~/.copilot/mcp-config.json.

2. Teach it to use memory

Add these lines to ~/.copilot/copilot-instructions.md, the instructions Copilot CLI reads in every project. Create the file if it does not exist.

~/.copilot/copilot-instructions.md
Use Alexein as my memory.
Before you answer anything about me, my work or my plans, search it with memory_search.
When I tell you something new, save it with memory_add, without asking.
Save small details too: preferences, people, places, dates and decisions.
Never save passwords, keys or other secrets.

Copilot CLI reads the file when a session starts, so start a new one with /new. /instructions shows the files it read. For one project only, put the lines in AGENTS.md or .github/copilot-instructions.md there instead.

3. Check it works

Run copilot mcp list in a terminal, or /mcp show alexein in copilot. alexein is listed, with its tools.

Ask: "What do you remember about me?" Copilot calls memory_search. It asks you to approve each tool call.

Tell it something new about you. Then open My memory: it is there within a few minutes.

Troubleshooting

  • The tools are missing. You have not signed in yet. Run /mcp, choose alexein and authenticate.
  • memory_add is missing. You chose Read only when you allowed it, or the key is Read. Disconnect it in My memory › AI assistants and sign in again with Read and save, or create a Read and write key and add the server again.
  • With a key: the server answers 401. ALEXEIN_API_KEY was empty when you ran copilot mcp add. Set it, run copilot mcp remove alexein, and add it again.

More in Troubleshooting.