This guide shows how to build a coding assistant – similar to an in-editor AI agent – that uses Spectron via MCP to remember coding conventions, past decisions, team preferences, and ongoing work across sessions.
What the agent remembers
A coding agent working on a repository accumulates a surprising amount of context that is useful across sessions:
Coding conventions: "We use
Result<T, Error>not exceptions in this codebase"Past decisions: "We chose Tanstack Query over SWR because of the devtools"
Team preferences: "Alice prefers functional components; Bob owns the auth module"
Ongoing work: "The migration to the analytics database is 80% complete, blocked on the auth service"
Documentation: Product specs, architecture decisions, API contracts
Without persistent memory, every new session starts from scratch. With Spectron, the agent can recall relevant context at the start of each conversation and update its memory as new decisions are made.
Installing the MCP server
Spectron provides an MCP server that exposes memory operations as tools. Install it into your editor using the MCP installer:
This registers the Spectron MCP server in your editor's MCP configuration. You will be prompted for your Spectron API key during installation.
Manual configuration
If you prefer to configure the MCP server manually, add it to your editor's MCP config:
Scope per repository
Scoping memory to a repository ensures that conventions from one project do not bleed into another. Use the project dimension in the scope:
With this scope, all memory stored during sessions for my-repo is isolated from memory for other projects. Team-wide knowledge (e.g. company-wide conventions) lives at the org scope and is readable by all project-scoped sessions.
Session start: loading context
At the beginning of each coding session, the agent should call memory_profile to load relevant context before it responds to the first user message:
This returns a structured snapshot of what Spectron knows about this project: ongoing work, decisions, preferences, and conventions. The agent includes this in its system context before the user's first message.
A typical profile for a coding agent might look like:
Storing decisions
When a significant decision is made during a session, use memory_store to persist it:
For team preferences and conventions, the agent can store these automatically when it identifies a directive in the conversation:
Documentation lookup with knowledge_search
When the user asks a question that might be answered by project documentation ingested into authoritative knowledge, use knowledge_search:
This searches the authoritative knowledge base for relevant passages from ingested documents (architecture decision records, API specs, README files).
To ingest project documentation into authoritative knowledge:
Full session flow
Here is what a typical coding session looks like with Spectron MCP integrated:
Session start
During the session
When a decision is made
Session end (optional)
Multi-developer teams
When multiple developers work on the same project, they share memory at the project scope. Each developer's session contributes to and reads from the same experiential memory.
For individual preferences, use the user dimension alongside project:
Alice's personal preferences (code style, preferred approaches) live at the user scope. Project-wide conventions live at the project scope. Both are accessible when Alice's session is active.