frinus-mcp 3.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.
@@ -0,0 +1,279 @@
1
+ /**
2
+ * Shared types for the Frinus MCP Server.
3
+ */
4
+ /** Standard MCP tool result content item. */
5
+ export interface ToolResultContent {
6
+ type: string;
7
+ text: string;
8
+ }
9
+ /** Standard MCP tool result. Index signature for MCP SDK compatibility. */
10
+ export interface ToolResult {
11
+ [x: string]: unknown;
12
+ content: ToolResultContent[];
13
+ isError?: boolean;
14
+ }
15
+ /** Arguments passed to a tool handler (parsed from MCP request). */
16
+ export type ToolArgs = Record<string, unknown>;
17
+ /** Signature for individual tool handler functions. */
18
+ export type ToolHandler = (args: ToolArgs, deps: ToolHandlerDeps) => Promise<ToolResult>;
19
+ /** Dependencies injected into every tool handler. */
20
+ export interface ToolHandlerDeps {
21
+ memoryClient: MemoryClientInterface;
22
+ agentClient: AgentClientInterface;
23
+ cpClient: CpClientInterface;
24
+ capture: InteractionCaptureInterface;
25
+ resolvedUserEmail: string | null;
26
+ resolvedUserId: string | null;
27
+ cpUrl: string;
28
+ }
29
+ /** Public surface of the AgentClient used by handlers. */
30
+ export interface AgentClientInterface {
31
+ createAgent(data: {
32
+ name: string;
33
+ template_id?: string;
34
+ universe_id?: string;
35
+ persona?: Record<string, unknown>;
36
+ team_id?: string;
37
+ is_team_lead?: boolean;
38
+ }): Promise<any>;
39
+ listAgents(orgId?: string): Promise<any>;
40
+ getAgent(agentId: string): Promise<any>;
41
+ updateAgentPersona(agentId: string, data: {
42
+ name?: string;
43
+ personality?: string;
44
+ instructions?: string;
45
+ greeting?: string;
46
+ forbidden_topics?: string[];
47
+ language?: string;
48
+ specialization?: string;
49
+ }): Promise<any>;
50
+ deleteAgent(agentId: string): Promise<any>;
51
+ bootstrapAgent(agentId: string): Promise<any>;
52
+ invokeAgent(data: {
53
+ agent_id?: string;
54
+ agent_name?: string;
55
+ message: string;
56
+ task_id?: string;
57
+ context?: Record<string, unknown>;
58
+ timeout_seconds?: number;
59
+ }): Promise<any>;
60
+ }
61
+ /** Public surface of the CpClient used by handlers. */
62
+ export interface CpClientInterface {
63
+ createUniverse(orgId: string, data: {
64
+ name: string;
65
+ slug: string;
66
+ description?: string;
67
+ }): Promise<any>;
68
+ listUniverses(orgId: string): Promise<any>;
69
+ updateUniverse(orgId: string, universeId: string, data: {
70
+ name?: string;
71
+ description?: string;
72
+ }): Promise<any>;
73
+ deleteUniverse(orgId: string, universeId: string): Promise<void>;
74
+ storeCredential(integrationRef: string, data: Record<string, unknown>, metadata?: Record<string, unknown>): Promise<any>;
75
+ getCredential(integrationRef: string): Promise<any>;
76
+ listCredentials(): Promise<any>;
77
+ deleteCredential(integrationRef: string): Promise<void>;
78
+ }
79
+ /** Public surface of the MemoryClient used by handlers. */
80
+ export interface MemoryClientInterface {
81
+ getTenantOrgId(): string | null;
82
+ getAuthMe(): Promise<any>;
83
+ startSession(data: {
84
+ agent_id?: string;
85
+ parent_session_id?: string;
86
+ }): Promise<any>;
87
+ endSession(sessionId: string): Promise<any>;
88
+ getSessionContext(data: {
89
+ session_id: string;
90
+ query: string;
91
+ agent_id?: string;
92
+ max_working_memory?: number;
93
+ max_long_term?: number;
94
+ include_topics?: boolean;
95
+ }): Promise<any>;
96
+ getSessionSummary(sessionId: string): Promise<any>;
97
+ clearSession(sessionId: string): Promise<any>;
98
+ storeMemory(data: {
99
+ agent_id: string;
100
+ content: string;
101
+ memory_type?: string;
102
+ scope?: string;
103
+ importance?: number;
104
+ user_id?: string;
105
+ created_by_user_id?: string;
106
+ metadata?: Record<string, unknown>;
107
+ context_id?: string;
108
+ credential_ref?: string;
109
+ }): Promise<any>;
110
+ searchMemories(data: {
111
+ query_text: string;
112
+ agent_id?: string;
113
+ memory_types?: string[];
114
+ limit?: number;
115
+ }): Promise<any>;
116
+ getMemory(memoryId: string): Promise<any>;
117
+ getAgentMemories(agentId: string, memoryType?: string, limit?: number): Promise<any>;
118
+ deleteMemory(memoryId: string): Promise<any>;
119
+ buildContext(data: {
120
+ agent_id: string;
121
+ task_description: string;
122
+ max_tokens?: number;
123
+ }): Promise<any>;
124
+ reinforceMemory(memoryId: string, boost?: number): Promise<any>;
125
+ weakenMemory(memoryId: string, penalty?: number): Promise<any>;
126
+ getWorkingMemory(contextId: string): Promise<any>;
127
+ addWorkingMemory(data: {
128
+ context_id: string;
129
+ content: string;
130
+ agent_id?: string;
131
+ task_id?: string;
132
+ ttl_seconds?: number;
133
+ }): Promise<any>;
134
+ clearWorkingMemory(contextId: string): Promise<any>;
135
+ captureStream(data: {
136
+ session_id: string;
137
+ content: string;
138
+ direction: string;
139
+ agent_id?: string;
140
+ importance?: number;
141
+ metadata?: Record<string, unknown>;
142
+ }): Promise<any>;
143
+ getSessionItems(sessionId: string, limit?: number): Promise<any>;
144
+ getRecentStreamItems(agentId?: string, limit?: number, includeForgotten?: boolean): Promise<any>;
145
+ processStream(batchSize?: number): Promise<any>;
146
+ searchWithAttention(data: {
147
+ query_text: string;
148
+ task_type?: string;
149
+ limit?: number;
150
+ agent_id?: string;
151
+ user_id?: string;
152
+ }): Promise<any>;
153
+ getUserContext(taskDescription: string, userEmail?: string): Promise<any>;
154
+ heartbeatTick(data: {
155
+ agent_id?: string;
156
+ context_id?: string;
157
+ session_id?: string;
158
+ }): Promise<any>;
159
+ reorientAgent(agentId: string, focus?: string): Promise<any>;
160
+ runSleepCycle(phases?: string[]): Promise<any>;
161
+ detectConflicts(similarityThreshold?: number, limit?: number): Promise<any>;
162
+ resolveConflict(data: {
163
+ keep_id: string;
164
+ supersede_id: string;
165
+ resolution_note: string;
166
+ }): Promise<any>;
167
+ detectRedundant(similarityThreshold?: number, limit?: number): Promise<any>;
168
+ hierarchyConsolidate(data: {
169
+ memory_ids: string[];
170
+ summary_content?: string;
171
+ agent_id?: string;
172
+ }): Promise<any>;
173
+ getHierarchyTree(memoryId: string): Promise<any>;
174
+ createConcept(data: {
175
+ name: string;
176
+ universe_id: string;
177
+ description?: string;
178
+ }): Promise<any>;
179
+ listUniverseConcepts(universeId: string): Promise<any>;
180
+ updateConcept(conceptId: string, data: {
181
+ name?: string;
182
+ description?: string;
183
+ }): Promise<any>;
184
+ deleteConcept(conceptId: string): Promise<any>;
185
+ createTheme(data: {
186
+ name: string;
187
+ concept_id: string;
188
+ description?: string;
189
+ }): Promise<any>;
190
+ listConceptThemes(conceptId: string): Promise<any>;
191
+ updateTheme(themeId: string, data: {
192
+ name?: string;
193
+ description?: string;
194
+ }): Promise<any>;
195
+ deleteTheme(themeId: string): Promise<any>;
196
+ createTopic(data: {
197
+ name: string;
198
+ theme_id: string;
199
+ description?: string;
200
+ status?: string;
201
+ }): Promise<any>;
202
+ listThemeTopics(themeId: string): Promise<any>;
203
+ updateTopic(topicId: string, data: {
204
+ name?: string;
205
+ description?: string;
206
+ }): Promise<any>;
207
+ updateTopicStatus(topicId: string, status: string): Promise<any>;
208
+ deleteTopic(topicId: string): Promise<any>;
209
+ createPoint(data: {
210
+ name: string;
211
+ topic_id: string;
212
+ description?: string;
213
+ status?: string;
214
+ }): Promise<any>;
215
+ listTopicPoints(topicId: string): Promise<any>;
216
+ updatePoint(pointId: string, data: {
217
+ name?: string;
218
+ description?: string;
219
+ content?: string;
220
+ }): Promise<any>;
221
+ updatePointStatus(pointId: string, status: string): Promise<any>;
222
+ deletePoint(pointId: string): Promise<any>;
223
+ getUniverseHierarchy(universeId: string): Promise<any>;
224
+ trainingTeach(data: {
225
+ content: string;
226
+ type?: string;
227
+ importance?: number;
228
+ universe_id?: string;
229
+ }): Promise<any>;
230
+ trainingQa(data: {
231
+ pairs: Array<{
232
+ question: string;
233
+ answer: string;
234
+ }>;
235
+ importance?: number;
236
+ universe_id?: string;
237
+ }): Promise<any>;
238
+ trainingStats(): Promise<any>;
239
+ trainingGaps(): Promise<any>;
240
+ trainingRecent(data?: {
241
+ limit?: number;
242
+ }): Promise<any>;
243
+ createTask(data: {
244
+ title: string;
245
+ description?: string;
246
+ assigned_agent_id?: string;
247
+ parent_task_id?: string;
248
+ priority?: number;
249
+ input_data?: Record<string, unknown>;
250
+ }): Promise<any>;
251
+ getTask(taskId: string): Promise<any>;
252
+ listTasks(data?: {
253
+ status?: string;
254
+ assigned_agent_id?: string;
255
+ parent_task_id?: string;
256
+ limit?: number;
257
+ }): Promise<any>;
258
+ updateTask(taskId: string, data: {
259
+ status?: string;
260
+ output_data?: Record<string, unknown>;
261
+ error_message?: string;
262
+ }): Promise<any>;
263
+ listSkills(category?: string): Promise<any>;
264
+ getAgentSkills(agentId: string): Promise<any>;
265
+ assignSkill(agentId: string, skillId: string, permission?: string): Promise<any>;
266
+ removeSkill(agentId: string, skillId: string): Promise<any>;
267
+ }
268
+ /** Public surface of InteractionCapture used by the server. */
269
+ export interface InteractionCaptureInterface {
270
+ sessionId: string;
271
+ getSessionId(): string;
272
+ captureToolCall(toolName: string, args: Record<string, unknown>, result: {
273
+ content: Array<{
274
+ type: string;
275
+ text: string;
276
+ }>;
277
+ isError?: boolean;
278
+ }): void;
279
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Shared types for the Frinus MCP Server.
3
+ */
4
+ export {};
package/manifest.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "manifest_version": "0.2",
3
+ "name": "frinus",
4
+ "display_name": "Frinus — Memória Cognitiva",
5
+ "version": "3.1.0",
6
+ "description": "Memória cognitiva de longo prazo para o Claude (φρήν + νοῦς). 70 ferramentas de memória, sessões, agentes e conhecimento.",
7
+ "long_description": "O Frinus dá ao Claude memória de longo prazo, identidade e inteligência persistente entre conversas. Conecta o Claude Desktop à plataforma Frinus (Memory Engine, Control Plane e Agent Service) via MCP. Basta colar sua chave de API pessoal — nada para instalar ou compilar.",
8
+ "author": {
9
+ "name": "Frinus",
10
+ "url": "https://frinus.rdxsec.com.br"
11
+ },
12
+ "homepage": "https://frinus.rdxsec.com.br",
13
+ "documentation": "https://github.com/frinus-ai/frinus-mcp",
14
+ "support": "https://github.com/frinus-ai/frinus-mcp/issues",
15
+ "icon": "icon.png",
16
+ "server": {
17
+ "type": "node",
18
+ "entry_point": "dist/index.js",
19
+ "mcp_config": {
20
+ "command": "node",
21
+ "args": ["${__dirname}/dist/index.js"],
22
+ "env": {
23
+ "FRINUS_API_KEY": "${user_config.api_key}",
24
+ "MEMORY_SERVICE_URL": "${user_config.memory_url}",
25
+ "FRINUS_CP_URL": "${user_config.cp_url}",
26
+ "AGENT_SERVICE_URL": "${user_config.agent_url}"
27
+ }
28
+ }
29
+ },
30
+ "user_config": {
31
+ "api_key": {
32
+ "type": "string",
33
+ "title": "Chave de API Frinus",
34
+ "description": "Sua chave pessoal (sk-frinus-...). Gere em frinus.rdxsec.com.br → Configurações → API Keys.",
35
+ "sensitive": true,
36
+ "required": true
37
+ },
38
+ "memory_url": {
39
+ "type": "string",
40
+ "title": "Memory Engine URL (avançado)",
41
+ "description": "Deixe o padrão, exceto se usar uma instância própria do Frinus.",
42
+ "default": "https://frinus-memory.rdxsec.com.br",
43
+ "required": false
44
+ },
45
+ "cp_url": {
46
+ "type": "string",
47
+ "title": "Control Plane URL (avançado)",
48
+ "description": "Deixe o padrão, exceto se usar uma instância própria do Frinus.",
49
+ "default": "https://frinus-api.rdxsec.com.br",
50
+ "required": false
51
+ },
52
+ "agent_url": {
53
+ "type": "string",
54
+ "title": "Agent Service URL (avançado)",
55
+ "description": "Deixe o padrão, exceto se usar uma instância própria do Frinus.",
56
+ "default": "https://frinus-agents.rdxsec.com.br",
57
+ "required": false
58
+ }
59
+ },
60
+ "compatibility": {
61
+ "claude_desktop": ">=0.10.0",
62
+ "platforms": ["darwin", "win32", "linux"],
63
+ "runtimes": {
64
+ "node": ">=18.0.0"
65
+ }
66
+ },
67
+ "keywords": [
68
+ "memory",
69
+ "cognitive",
70
+ "rag",
71
+ "frinus",
72
+ "long-term-memory",
73
+ "agents"
74
+ ],
75
+ "license": "SEE LICENSE IN repository"
76
+ }
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "frinus-mcp",
3
+ "version": "3.1.0",
4
+ "description": "Frinus - MCP Server for Cognitive Memory (φρήν + νοῦς). Long-term memory, sessions, agents and knowledge for Claude and any MCP client.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "frinus-mcp": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "manifest.json",
13
+ "README.md"
14
+ ],
15
+ "engines": {
16
+ "node": ">=18.0.0"
17
+ },
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "start": "node dist/index.js",
21
+ "dev": "tsx src/index.ts",
22
+ "pack:mcpb": "./scripts/pack-mcpb.sh",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/frinus-ai/frinus-mcp.git"
28
+ },
29
+ "homepage": "https://frinus.rdxsec.com.br",
30
+ "bugs": {
31
+ "url": "https://github.com/frinus-ai/frinus-mcp/issues"
32
+ },
33
+ "keywords": [
34
+ "mcp",
35
+ "model-context-protocol",
36
+ "frinus",
37
+ "memory",
38
+ "cognitive-memory",
39
+ "long-term-memory",
40
+ "rag",
41
+ "agents",
42
+ "claude"
43
+ ],
44
+ "license": "MIT",
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "dependencies": {
49
+ "@modelcontextprotocol/sdk": "^1.0.0",
50
+ "axios": "^1.7.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^22.0.0",
54
+ "typescript": "^5.6.0",
55
+ "tsx": "^4.19.0"
56
+ }
57
+ }