trapic-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -0
  3. package/bin/trapic-mcp.mjs +902 -0
  4. package/bin/wrapper.sh +5 -0
  5. package/dist/archive.d.ts +7 -0
  6. package/dist/archive.js +116 -0
  7. package/dist/audit.d.ts +5 -0
  8. package/dist/audit.js +16 -0
  9. package/dist/background.d.ts +8 -0
  10. package/dist/background.js +17 -0
  11. package/dist/config.d.ts +46 -0
  12. package/dist/config.js +20 -0
  13. package/dist/conflict.d.ts +14 -0
  14. package/dist/conflict.js +103 -0
  15. package/dist/embedding.d.ts +6 -0
  16. package/dist/embedding.js +74 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +104 -0
  19. package/dist/llm.d.ts +10 -0
  20. package/dist/llm.js +47 -0
  21. package/dist/ollama.d.ts +11 -0
  22. package/dist/ollama.js +63 -0
  23. package/dist/quota.d.ts +7 -0
  24. package/dist/quota.js +16 -0
  25. package/dist/rate-limit.d.ts +5 -0
  26. package/dist/rate-limit.js +38 -0
  27. package/dist/request-context.d.ts +3 -0
  28. package/dist/request-context.js +12 -0
  29. package/dist/supabase.d.ts +2 -0
  30. package/dist/supabase.js +16 -0
  31. package/dist/team-access.d.ts +5 -0
  32. package/dist/team-access.js +35 -0
  33. package/dist/tools/active.d.ts +2 -0
  34. package/dist/tools/active.js +63 -0
  35. package/dist/tools/assert.d.ts +3 -0
  36. package/dist/tools/assert.js +141 -0
  37. package/dist/tools/chain.d.ts +2 -0
  38. package/dist/tools/chain.js +118 -0
  39. package/dist/tools/context.d.ts +7 -0
  40. package/dist/tools/context.js +270 -0
  41. package/dist/tools/create.d.ts +2 -0
  42. package/dist/tools/create.js +126 -0
  43. package/dist/tools/extract.d.ts +2 -0
  44. package/dist/tools/extract.js +95 -0
  45. package/dist/tools/preload.d.ts +10 -0
  46. package/dist/tools/preload.js +112 -0
  47. package/dist/tools/search.d.ts +2 -0
  48. package/dist/tools/search.js +92 -0
  49. package/dist/tools/summary.d.ts +2 -0
  50. package/dist/tools/summary.js +176 -0
  51. package/dist/tools/update.d.ts +2 -0
  52. package/dist/tools/update.js +134 -0
  53. package/dist/worker.d.ts +15 -0
  54. package/dist/worker.js +700 -0
  55. package/package.json +59 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Trapic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,152 @@
1
+ # Trapic MCP
2
+
3
+ > AI's long-term memory layer — capture, search, and connect knowledge across AI coding sessions.
4
+
5
+ Trapic is an MCP (Model Context Protocol) server that automatically records decisions, facts, conventions, and discoveries from your AI conversations. Knowledge persists across sessions and devices.
6
+
7
+ ## Why Trapic?
8
+
9
+ Every day you make dozens of decisions with AI — why this framework, how that bug was fixed, what conventions the team follows. **All of it disappears when the session ends.**
10
+
11
+ Trapic captures this knowledge automatically and makes it searchable, connected, and persistent.
12
+
13
+ ## Quick Start
14
+
15
+ ### 1. Get your API token
16
+
17
+ Sign up at [trapic.ai](https://trapic.ai) and create an API token.
18
+
19
+ ### 2. Install
20
+
21
+ ```bash
22
+ npm install -g trapic-mcp
23
+ ```
24
+
25
+ ### 3. Login
26
+
27
+ ```bash
28
+ trapic login
29
+ ```
30
+
31
+ ### 4. Connect to your AI tool
32
+
33
+ **Claude Code** — Add to `~/.claude/mcp.json`:
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "trapic": {
39
+ "type": "url",
40
+ "url": "https://mcp.trapic.ai/mcp",
41
+ "headers": {
42
+ "Authorization": "Bearer YOUR_TOKEN"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ **Cursor** — Add to `.cursor/mcp.json`:
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "trapic": {
55
+ "url": "https://mcp.trapic.ai/mcp",
56
+ "headers": {
57
+ "Authorization": "Bearer YOUR_TOKEN"
58
+ }
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ **Other platforms** — See [full setup guide](https://trapic.ai/docs).
65
+
66
+ ### 5. Add instructions to your project
67
+
68
+ Create a `CLAUDE.md` (or `.cursorrules`, etc.) in your project root:
69
+
70
+ ```markdown
71
+ ## Auto-load Knowledge
72
+ At the start of every conversation, read the MCP resource
73
+ `trapic://knowledge/project/your-project` to load existing knowledge.
74
+
75
+ ## Knowledge Capture
76
+ When working on this project, automatically record important knowledge
77
+ using `trapic_create`:
78
+ - **decision**: Technical choices (why X over Y)
79
+ - **fact**: Non-obvious discoveries
80
+ - **convention**: Established patterns
81
+ - **state**: Project milestones
82
+
83
+ Call trapic_create with: content, context, type, tags: ["project:your-project", ...]
84
+ ```
85
+
86
+ ## MCP Tools
87
+
88
+ | Tool | Description |
89
+ |------|-------------|
90
+ | `trapic_create` | Record a knowledge entry with auto-contextualize and conflict detection |
91
+ | `trapic_search` | Semantic search across your knowledge base |
92
+ | `trapic_update` | Update a trace's content, status, or metadata |
93
+ | `trapic_get_chain` | Retrieve the causal chain upstream from a trace |
94
+ | `trapic_get_effects` | Find traces caused by a given trace |
95
+ | `trapic_get_active` | Get all active traces, optionally filtered by tags |
96
+ | `trapic_get_context` | Get a context cluster with its related traces |
97
+ | `trapic_find_contexts` | Search for relevant context clusters |
98
+ | `trapic_contextualize` | Assign a trace to context clusters using LLM |
99
+ | `trapic_extract` | Extract structured knowledge from text |
100
+ | `trapic_auto_summary` | Batch extract traces from a conversation summary |
101
+
102
+ ## MCP Resources
103
+
104
+ | Resource | Description |
105
+ |----------|-------------|
106
+ | `trapic://knowledge/active` | All active knowledge (conventions, preferences, states) |
107
+ | `trapic://knowledge/project/{name}` | Project-specific knowledge |
108
+
109
+ ## Features
110
+
111
+ - **Zero-friction capture** — AI records knowledge during work, no manual entry
112
+ - **Semantic search** — Find knowledge by meaning, not keywords
113
+ - **Auto-contextualize** — New knowledge automatically linked to related clusters
114
+ - **Conflict detection** — Contradictions detected and flagged or auto-resolved
115
+ - **Causal chains** — Trace how decisions led to other decisions
116
+ - **Cross-platform** — Works with Claude Code, Cursor, Windsurf, Cline, Copilot, Gemini
117
+ - **Field-level encryption** — Content encrypted at rest with per-user keys
118
+ - **Team collaboration** — Share knowledge across team members
119
+
120
+ ## CLI Commands
121
+
122
+ ```bash
123
+ trapic login # Authenticate with your Trapic account
124
+ trapic logout # Clear saved credentials
125
+ trapic whoami # Show current user info
126
+ trapic status # Show connection status
127
+ trapic search <query> # Search your knowledge base
128
+ trapic list # List recent traces
129
+ trapic init # Initialize project with rules files
130
+ trapic token # Manage API tokens
131
+ ```
132
+
133
+ ## Self-hosting
134
+
135
+ Trapic MCP can be self-hosted. You'll need:
136
+
137
+ - Supabase project (PostgreSQL + Auth)
138
+ - OpenAI API key (for embeddings)
139
+ - Groq API key (optional, for LLM features)
140
+
141
+ See the [self-hosting guide](https://trapic.ai/docs) for details.
142
+
143
+ ## License
144
+
145
+ MIT — see [LICENSE](./LICENSE)
146
+
147
+ ## Links
148
+
149
+ - [Website](https://trapic.ai)
150
+ - [Documentation](https://trapic.ai/docs)
151
+ - [GitHub](https://github.com/nickjazz/trapic)
152
+ - [Issues](https://github.com/nickjazz/trapic/issues)