| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 6 | 6 | 0% |
| Commands | 0 | 0 | 1 | 0% |
| Section tags | 1 | 0 | 6 | 14% |
What each file covers
Sections
0 shared · 6 only in A · 6 only in B- − @second-brain/mcp-server — Agent Instructions
- − Entry Point
- − Transports
- − Tools (32 total)
- − Resources
- − Adding a New MCP Tool
- + Second Brain — Agent Instructions
- + Monorepo Map
- + Commands
- + Conventions
- + Data Model
- + Docs
Commands
0 shared · 0 only in A · 1 only in B- + pnpm install / build / test / check-types / lint / dev / clean
Section tags
1 shared · 0 only in A · 6 only in B- + setup
- + test
- + code-style
- + types
- + monorepo
- + docs
- agent-behaviour
Line diff
thangaram611/second-brain · packages/mcp-server/AGENTS.md
@@ −1 @@
1# @second-brain/mcp-server — Agent Instructions
2
3MCP (Model Context Protocol) server exposing 32 tools for knowledge graph operations.
4
5## Entry Point
6
7`src/server.ts` → `createMcpServer()` registers all tools and resources.
8
9## Transports
10
11- `src/stdio.ts` — stdio transport (for CLI-based MCP clients)
12- `src/http.ts` — Streamable HTTP transport
13- `src/transports/` — Transport helpers
14
15## Tools (32 total)
16
17| File | Category | Count |
18|------|----------|-------|
19| `src/tools/read-tools.ts` | Read operations | 15 |
20| `src/tools/write-tools.ts` | Write operations | 12 |
21| `src/tools/pipeline-tools.ts` | Pipeline operations | 5 |
22| `src/tools/formatters.ts` | Response formatting helpers | — |
23
24## Resources
25
26`src/resources/` — MCP resource definitions (graph metadata, schemas).
27
28## Adding a New MCP Tool
29
301. Add tool definition in the appropriate file under `src/tools/`
312. Register in `src/server.ts` via `createMcpServer()`
323. Follow existing patterns: Zod schema for input, formatter for output
33
thangaram611/second-brain · AGENTS.md
@@ +1 @@
1# Second Brain — Agent Instructions
2
3Developer knowledge graph — shared engineering memory for teams ("git remembers the code; Second Brain remembers why"). pnpm monorepo, Turborepo, Node.js 24+, TypeScript 5.8+ strict, ESM only.
4
5Each package/app has its own AGENTS.md with package-specific instructions.
6
7## Monorepo Map
8
9```
10packages/types → Shared TS types
11packages/core → Graph engine (SQLite + Drizzle + FTS5 + sqlite-vec)
12packages/collectors → Data collectors + streaming providers
13packages/ingestion → LLM extraction + embedding pipeline
14packages/sync → Yjs CRDT sync bridge
15packages/mcp-server → MCP tools (32 tools, stdio + HTTP)
16apps/server → Express 5 REST + WebSocket (:7430)
17apps/ui → React 19 + Cytoscape.js + Zustand (:5173)
18apps/relay → Hocuspocus CRDT relay (:7421)
19tools/cli → brain CLI (Commander.js)
20```
21
22## Commands
23
24```bash
25pnpm install / build / test / check-types / lint / dev / clean
26```
27
28Per-package: `cd <pkg> && pnpm test|build|dev`
29
30## Conventions
31
32- ESM only (`"type": "module"`), `.mjs`/`.d.mts` output, `tsdown` for builds
33- ULIDs via `ulidx` for IDs — never UUID
34- ISO 8601 strings for timestamps — never unix/Date
35- SQLite (better-sqlite3) + Drizzle ORM, WAL mode
36- Zod v4 for external input validation
37- Namespace on all entities/relations: `'personal'` = local, project ID = synced
38- Vitest + in-memory SQLite (`:memory:`) for tests
39- Named exports, re-export from package `index.ts`
40- Workspace imports (`@second-brain/core`, `@second-brain/types`)
41- Strict mode, no `any`, no path aliases
42
43## Data Model
44
45- **15 entity types**: concept, decision, pattern, person, file, symbol, event, tool, fact, conversation, reference, pull_request, merge_request, branch, review
46- **20 relation types**: relates_to, depends_on, implements, supersedes, contradicts, derived_from, authored_by, decided_in, uses, tests, contains, co_changes_with, preceded_by, blocks, reviewed_by, merged_in_mr, merged_in_pr, touches_file, owns, parallel_with
47
48Defined in `packages/types/src/entity.ts` and `packages/types/src/relation.ts`.
49
50## Docs
51
52- [docs/architecture.md](./docs/architecture.md) — Full technical architecture
53- [docs/getting-started.md](./docs/getting-started.md) — Usage guide
54- [docs/api-reference.md](./docs/api-reference.md) — REST API + MCP + CLI reference
55
@@ −1 +1 @@
1−# @second-brain/mcp-server — Agent Instructions
1+# Second Brain — Agent Instructions
22
3−MCP (Model Context Protocol) server exposing 32 tools for knowledge graph operations.
3+Developer knowledge graph — shared engineering memory for teams ("git remembers the code; Second Brain remembers why"). pnpm monorepo, Turborepo, Node.js 24+, TypeScript 5.8+ strict, ESM only.
44
5−## Entry Point
5+Each package/app has its own AGENTS.md with package-specific instructions.
66
7−`src/server.ts` → `createMcpServer()` registers all tools and resources.
7+## Monorepo Map
88
9−## Transports
9+```
10+packages/types → Shared TS types
11+packages/core → Graph engine (SQLite + Drizzle + FTS5 + sqlite-vec)
12+packages/collectors → Data collectors + streaming providers
13+packages/ingestion → LLM extraction + embedding pipeline
14+packages/sync → Yjs CRDT sync bridge
15+packages/mcp-server → MCP tools (32 tools, stdio + HTTP)
16+apps/server → Express 5 REST + WebSocket (:7430)
17+apps/ui → React 19 + Cytoscape.js + Zustand (:5173)
18+apps/relay → Hocuspocus CRDT relay (:7421)
19+tools/cli → brain CLI (Commander.js)
20+```
1021
11−- `src/stdio.ts` — stdio transport (for CLI-based MCP clients)
12−- `src/http.ts` — Streamable HTTP transport
13−- `src/transports/` — Transport helpers
22+## Commands
1423
15−## Tools (32 total)
24+```bash
25+pnpm install / build / test / check-types / lint / dev / clean
26+```
1627
17−| File | Category | Count |
18−|------|----------|-------|
19−| `src/tools/read-tools.ts` | Read operations | 15 |
20−| `src/tools/write-tools.ts` | Write operations | 12 |
21−| `src/tools/pipeline-tools.ts` | Pipeline operations | 5 |
22−| `src/tools/formatters.ts` | Response formatting helpers | — |
28+Per-package: `cd <pkg> && pnpm test|build|dev`
2329
24−## Resources
30+## Conventions
2531
26−`src/resources/` — MCP resource definitions (graph metadata, schemas).
32+- ESM only (`"type": "module"`), `.mjs`/`.d.mts` output, `tsdown` for builds
33+- ULIDs via `ulidx` for IDs — never UUID
34+- ISO 8601 strings for timestamps — never unix/Date
35+- SQLite (better-sqlite3) + Drizzle ORM, WAL mode
36+- Zod v4 for external input validation
37+- Namespace on all entities/relations: `'personal'` = local, project ID = synced
38+- Vitest + in-memory SQLite (`:memory:`) for tests
39+- Named exports, re-export from package `index.ts`
40+- Workspace imports (`@second-brain/core`, `@second-brain/types`)
41+- Strict mode, no `any`, no path aliases
2742
28−## Adding a New MCP Tool
43+## Data Model
2944
30−1. Add tool definition in the appropriate file under `src/tools/`
31−2. Register in `src/server.ts` via `createMcpServer()`
32−3. Follow existing patterns: Zod schema for input, formatter for output
45+- **15 entity types**: concept, decision, pattern, person, file, symbol, event, tool, fact, conversation, reference, pull_request, merge_request, branch, review
46+- **20 relation types**: relates_to, depends_on, implements, supersedes, contradicts, derived_from, authored_by, decided_in, uses, tests, contains, co_changes_with, preceded_by, blocks, reviewed_by, merged_in_mr, merged_in_pr, touches_file, owns, parallel_with
47+
48+Defined in `packages/types/src/entity.ts` and `packages/types/src/relation.ts`.
49+
50+## Docs
51+
52+- [docs/architecture.md](./docs/architecture.md) — Full technical architecture
53+- [docs/getting-started.md](./docs/getting-started.md) — Usage guide
54+- [docs/api-reference.md](./docs/api-reference.md) — REST API + MCP + CLI reference
3355
