mentat-mcp 1.0.1 → 1.0.2

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Agent Marketplace MCP Server
1
+ # Mentat MCP Server
2
2
 
3
3
  Terminal-first AI agent marketplace. Execute skills and hire workers directly from Claude Code.
4
4
 
@@ -6,11 +6,11 @@ Terminal-first AI agent marketplace. Execute skills and hire workers directly fr
6
6
 
7
7
  ```bash
8
8
  # Option 1: Published package (when available)
9
- npx @agent-marketplace/mcp-server setup
9
+ npx mentat-mcp setup
10
10
 
11
11
  # Option 2: Local development
12
- git clone <repo>
13
- cd mcp-server
12
+ git clone https://github.com/vgardrinier/mentat
13
+ cd mentat/mcp-server
14
14
  npm install
15
15
  npm run build
16
16
  npm run setup
@@ -24,10 +24,10 @@ The setup wizard will:
24
24
 
25
25
  ## 💡 Usage
26
26
 
27
- After setup, use `@agentmarketplace` in Claude Code:
27
+ After setup, use `@mentat` in Claude Code:
28
28
 
29
29
  ```
30
- You: @agentmarketplace execute_skill --skillId seo-meta-tags --targetFiles ["app/page.tsx"]
30
+ You: @mentat execute_skill --skillId seo-meta-tags --targetFiles ["app/page.tsx"]
31
31
 
32
32
  Claude: [Loads skill instructions, gathers context, and uses Edit tool to make changes]
33
33
  ```
@@ -72,49 +72,44 @@ If the automatic setup fails, manually add to `~/.config/claude/claude_desktop_c
72
72
  ```json
73
73
  {
74
74
  "mcpServers": {
75
- "agentmarketplace": {
75
+ "mentat": {
76
76
  "command": "node",
77
- "args": ["/path/to/mcp-server/dist/index.js"],
77
+ "args": ["/path/to/mentat/mcp-server/dist/index.js"],
78
78
  "env": {
79
79
  "AUTH_TOKEN": "your_token_here",
80
- "API_URL": "https://agentmarketplace.com"
80
+ "API_URL": "http://localhost:3000"
81
81
  }
82
82
  }
83
83
  }
84
84
  }
85
85
  ```
86
86
 
87
- Get your token at: https://agentmarketplace.com/settings/api
87
+ Get your token by running the setup command or accessing your local instance.
88
88
 
89
89
  ## 📖 Documentation
90
90
 
91
- - **Setup Guide**: https://agentmarketplace.com/docs/setup
92
- - **Skills Catalog**: https://agentmarketplace.com/skills
93
- - **API Reference**: https://agentmarketplace.com/docs/api
94
- - **Troubleshooting**: https://agentmarketplace.com/docs/troubleshooting
91
+ See the main [README](https://github.com/vgardrinier/mentat) for full documentation.
95
92
 
96
93
  ## 🐛 Troubleshooting
97
94
 
98
95
  **MCP server not showing in Claude Code?**
99
96
  1. Restart Claude Code completely
100
- 2. Check config path: `cat ~/.config/claude/claude_desktop_config.json`
97
+ 2. Check config path: `cat ~/Library/Application\ Support/Claude/claude_desktop_config.json` (macOS)
101
98
  3. Check logs: `tail -f ~/Library/Logs/Claude/mcp.log`
102
99
 
103
100
  **Skills not loading?**
104
- 1. Check API connection: `curl https://agentmarketplace.com/api/skills`
101
+ 1. Check API connection: `curl http://localhost:3000/api/skills`
105
102
  2. Verify auth token is set
106
103
  3. Check console for errors
107
104
 
108
105
  **Need help?**
109
- - Web Dashboard: https://agentmarketplace.com/help
110
- - Documentation: https://agentmarketplace.com/docs
111
- - Email: support@agentmarketplace.com
106
+ - GitHub: https://github.com/vgardrinier/mentat/issues
112
107
 
113
108
  ## 🔒 Security
114
109
 
115
- - API tokens are stored locally in `~/.agentmarketplace/config.json`
110
+ - API tokens are stored locally in `~/.mentat/config.json`
116
111
  - Tokens are long-lived but can be revoked anytime
117
- - Skills run locally, no code sent to our servers
112
+ - Skills run locally, no code sent to external servers
118
113
  - Workers receive only necessary context (secrets scanner active)
119
114
 
120
115
  ## 📝 License
package/dist/index.js CHANGED
@@ -7,11 +7,11 @@ import path from 'path';
7
7
  const API_BASE_URL = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000';
8
8
  const WORKSPACE_PATH = process.cwd();
9
9
  const SKILLS_PATH = path.join(WORKSPACE_PATH, 'skills');
10
- class AgentMarketplaceServer {
10
+ class MentatServer {
11
11
  constructor() {
12
12
  this.apiKey = null;
13
13
  this.server = new Server({
14
- name: 'agent-marketplace',
14
+ name: 'mentat',
15
15
  version: '2.0.0',
16
16
  }, {
17
17
  capabilities: {
@@ -346,8 +346,8 @@ class AgentMarketplaceServer {
346
346
  async run() {
347
347
  const transport = new StdioServerTransport();
348
348
  await this.server.connect(transport);
349
- console.error('Agent Marketplace MCP server running on stdio');
349
+ console.error('Mentat MCP server running on stdio');
350
350
  }
351
351
  }
352
- const server = new AgentMarketplaceServer();
352
+ const server = new MentatServer();
353
353
  server.run().catch(console.error);
package/dist/setup.js CHANGED
@@ -10,7 +10,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
10
  const API_URL = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000';
11
11
  const SETUP_PORT = 3456;
12
12
  /**
13
- * Terminal-first setup for Agent Marketplace MCP
13
+ * Terminal-first setup for Mentat MCP
14
14
  *
15
15
  * Flow:
16
16
  * 1. Start local server to receive auth token
@@ -43,7 +43,7 @@ async function setup() {
43
43
  console.log('Next steps:');
44
44
  console.log('1. Restart Claude Code');
45
45
  console.log('2. Open any project');
46
- console.log('3. Try: @agentmarketplace execute_skill --skillId seo-meta-tags');
46
+ console.log('3. Try: @mentat execute_skill --skillId seo-meta-tags');
47
47
  console.log('');
48
48
  console.log('Available skills:');
49
49
  console.log(' • seo-meta-tags - Add SEO meta tags');
@@ -53,8 +53,10 @@ async function setup() {
53
53
  console.log(' • fix-eslint - Fix ESLint errors');
54
54
  console.log(' • optimize-images - Optimize images');
55
55
  console.log('');
56
- console.log('Need help? https://github.com/vgardrinier/a2a_marketplace');
56
+ console.log('Need help? https://github.com/vgardrinier/mentat');
57
57
  console.log('');
58
+ // Exit cleanly
59
+ process.exit(0);
58
60
  }
59
61
  /**
60
62
  * Start local server to receive auth token from web callback
@@ -77,39 +79,67 @@ function startCallbackServer() {
77
79
  <!DOCTYPE html>
78
80
  <html>
79
81
  <head>
80
- <title>Setup Complete</title>
82
+ <meta charset="utf-8">
83
+ <title>Mentat Setup Complete</title>
81
84
  <style>
82
85
  body {
83
- font-family: system-ui, -apple-system, sans-serif;
86
+ font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
84
87
  display: flex;
85
88
  align-items: center;
86
89
  justify-content: center;
87
90
  height: 100vh;
88
91
  margin: 0;
89
- background: #f5f5f5;
92
+ background: #000;
93
+ color: #4ade80;
90
94
  }
91
95
  .container {
92
- text-align: center;
93
- background: white;
96
+ border: 2px solid #166534;
97
+ background: #0a0a0a;
94
98
  padding: 48px;
95
- border-radius: 12px;
96
- box-shadow: 0 4px 6px rgba(0,0,0,0.1);
99
+ border-radius: 8px;
100
+ max-width: 600px;
101
+ }
102
+ .header {
103
+ color: #4ade80;
104
+ font-size: 14px;
105
+ white-space: pre;
106
+ margin-bottom: 24px;
107
+ }
108
+ .message {
109
+ color: #4ade80;
110
+ margin: 16px 0;
111
+ font-size: 16px;
112
+ }
113
+ .note {
114
+ color: #6b7280;
115
+ font-size: 14px;
116
+ margin-top: 24px;
97
117
  }
98
- h1 { color: #10b981; margin: 0 0 16px 0; }
99
- p { color: #6b7280; margin: 0; }
100
118
  </style>
101
119
  </head>
102
120
  <body>
103
121
  <div class="container">
104
- <h1>✅ Authentication Complete!</h1>
105
- <p>You can close this window and return to your terminal.</p>
122
+ <div class="header">╔════════════════════════════════════════════════╗
123
+ ║ ✓ MENTAT SETUP COMPLETE ║
124
+ ╚════════════════════════════════════════════════╝</div>
125
+ <div class="message">$ Authentication successful</div>
126
+ <div class="note">// You can close this window and return to your terminal</div>
106
127
  </div>
107
128
  </body>
108
129
  </html>
109
130
  `);
110
131
  // Close server and resolve with token
111
- server.close();
112
- resolve(token);
132
+ server.close(() => {
133
+ resolve(token);
134
+ });
135
+ }
136
+ });
137
+ server.on('error', (err) => {
138
+ if (err.code === 'EADDRINUSE') {
139
+ reject(new Error(`Port ${SETUP_PORT} is already in use. Please close other applications and try again.`));
140
+ }
141
+ else {
142
+ reject(err);
113
143
  }
114
144
  });
115
145
  server.listen(SETUP_PORT, () => {
@@ -123,7 +153,7 @@ function startCallbackServer() {
123
153
  // Timeout after 5 minutes
124
154
  setTimeout(() => {
125
155
  server.close();
126
- reject(new Error('Setup timed out after 5 minutes'));
156
+ reject(new Error('Setup timed out after 5 minutes. Please try again.'));
127
157
  }, 5 * 60 * 1000);
128
158
  });
129
159
  }
@@ -204,8 +234,18 @@ function openBrowser(url) {
204
234
  // Run setup
205
235
  setup().catch((error) => {
206
236
  console.error('');
207
- console.error('❌ Setup failed:', error.message);
237
+ console.error('╔════════════════════════════════════════════════╗');
238
+ console.error('║ ❌ SETUP FAILED ║');
239
+ console.error('╚════════════════════════════════════════════════╝');
240
+ console.error('');
241
+ console.error('Error:', error.message);
242
+ console.error('');
243
+ console.error('Common fixes:');
244
+ console.error(' • Make sure you\'re signed in at http://localhost:3000');
245
+ console.error(' • Check that port 3456 is not in use');
246
+ console.error(' • Try running the command again');
247
+ console.error('');
248
+ console.error('Need help? https://github.com/vgardrinier/mentat');
208
249
  console.error('');
209
- console.error('Need help? https://github.com/vgardrinier/a2a_marketplace');
210
250
  process.exit(1);
211
251
  });
package/dist/skills.js CHANGED
@@ -30,19 +30,23 @@ export class SkillLibrary {
30
30
  }
31
31
  /**
32
32
  * Gather file context based on patterns or explicit files
33
+ * If explicit files are provided, patterns are ignored (respects user intent)
33
34
  */
34
35
  async gatherContext(patterns = [], explicitFiles = []) {
35
36
  const filePaths = new Set();
36
37
  // Add explicit files
37
38
  explicitFiles.forEach((f) => filePaths.add(path.resolve(this.workspacePath, f)));
38
- // Add files matching patterns
39
- for (const pattern of patterns) {
40
- const matches = await glob(pattern, {
41
- cwd: this.workspacePath,
42
- absolute: true,
43
- ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**'],
44
- });
45
- matches.slice(0, LIMITS.maxFiles).forEach((f) => filePaths.add(f));
39
+ // Only use patterns if no explicit files were provided
40
+ // This prevents bloat when user specifies exact target files
41
+ if (filePaths.size === 0) {
42
+ for (const pattern of patterns) {
43
+ const matches = await glob(pattern, {
44
+ cwd: this.workspacePath,
45
+ absolute: true,
46
+ ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**'],
47
+ });
48
+ matches.slice(0, LIMITS.maxFiles).forEach((f) => filePaths.add(f));
49
+ }
46
50
  }
47
51
  // Rank and limit files
48
52
  const rankedFiles = await this.rankFiles(Array.from(filePaths));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mentat-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server for terminal AI tools (Claude Code, Cursor CLI, Codex CLI) - execute skills and hire AI workers",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -28,12 +28,12 @@
28
28
  "license": "MIT",
29
29
  "repository": {
30
30
  "type": "git",
31
- "url": "git+https://github.com/vgardrinier/a2a_marketplace.git",
31
+ "url": "git+https://github.com/vgardrinier/mentat.git",
32
32
  "directory": "mcp-server"
33
33
  },
34
- "homepage": "https://github.com/vgardrinier/a2a_marketplace#readme",
34
+ "homepage": "https://github.com/vgardrinier/mentat#readme",
35
35
  "bugs": {
36
- "url": "https://github.com/vgardrinier/a2a_marketplace/issues"
36
+ "url": "https://github.com/vgardrinier/mentat/issues"
37
37
  },
38
38
  "dependencies": {
39
39
  "@modelcontextprotocol/sdk": "^0.5.0",
package/src/index.ts CHANGED
@@ -12,7 +12,7 @@ const API_BASE_URL = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000';
12
12
  const WORKSPACE_PATH = process.cwd();
13
13
  const SKILLS_PATH = path.join(WORKSPACE_PATH, 'skills');
14
14
 
15
- class AgentMarketplaceServer {
15
+ class MentatServer {
16
16
  private server: Server;
17
17
  private skillLibrary: SkillLibrary;
18
18
  private apiKey: string | null = null;
@@ -20,7 +20,7 @@ class AgentMarketplaceServer {
20
20
  constructor() {
21
21
  this.server = new Server(
22
22
  {
23
- name: 'agent-marketplace',
23
+ name: 'mentat',
24
24
  version: '2.0.0',
25
25
  },
26
26
  {
@@ -418,9 +418,9 @@ class AgentMarketplaceServer {
418
418
  async run() {
419
419
  const transport = new StdioServerTransport();
420
420
  await this.server.connect(transport);
421
- console.error('Agent Marketplace MCP server running on stdio');
421
+ console.error('Mentat MCP server running on stdio');
422
422
  }
423
423
  }
424
424
 
425
- const server = new AgentMarketplaceServer();
425
+ const server = new MentatServer();
426
426
  server.run().catch(console.error);
package/src/setup.ts CHANGED
@@ -23,7 +23,7 @@ interface ClaudeConfig {
23
23
  }
24
24
 
25
25
  /**
26
- * Terminal-first setup for Agent Marketplace MCP
26
+ * Terminal-first setup for Mentat MCP
27
27
  *
28
28
  * Flow:
29
29
  * 1. Start local server to receive auth token
@@ -60,7 +60,7 @@ async function setup() {
60
60
  console.log('Next steps:');
61
61
  console.log('1. Restart Claude Code');
62
62
  console.log('2. Open any project');
63
- console.log('3. Try: @agentmarketplace execute_skill --skillId seo-meta-tags');
63
+ console.log('3. Try: @mentat execute_skill --skillId seo-meta-tags');
64
64
  console.log('');
65
65
  console.log('Available skills:');
66
66
  console.log(' • seo-meta-tags - Add SEO meta tags');
@@ -70,8 +70,11 @@ async function setup() {
70
70
  console.log(' • fix-eslint - Fix ESLint errors');
71
71
  console.log(' • optimize-images - Optimize images');
72
72
  console.log('');
73
- console.log('Need help? https://github.com/vgardrinier/a2a_marketplace');
73
+ console.log('Need help? https://github.com/vgardrinier/mentat');
74
74
  console.log('');
75
+
76
+ // Exit cleanly
77
+ process.exit(0);
75
78
  }
76
79
 
77
80
  /**
@@ -98,40 +101,68 @@ function startCallbackServer(): Promise<string> {
98
101
  <!DOCTYPE html>
99
102
  <html>
100
103
  <head>
101
- <title>Setup Complete</title>
104
+ <meta charset="utf-8">
105
+ <title>Mentat Setup Complete</title>
102
106
  <style>
103
107
  body {
104
- font-family: system-ui, -apple-system, sans-serif;
108
+ font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
105
109
  display: flex;
106
110
  align-items: center;
107
111
  justify-content: center;
108
112
  height: 100vh;
109
113
  margin: 0;
110
- background: #f5f5f5;
114
+ background: #000;
115
+ color: #4ade80;
111
116
  }
112
117
  .container {
113
- text-align: center;
114
- background: white;
118
+ border: 2px solid #166534;
119
+ background: #0a0a0a;
115
120
  padding: 48px;
116
- border-radius: 12px;
117
- box-shadow: 0 4px 6px rgba(0,0,0,0.1);
121
+ border-radius: 8px;
122
+ max-width: 600px;
123
+ }
124
+ .header {
125
+ color: #4ade80;
126
+ font-size: 14px;
127
+ white-space: pre;
128
+ margin-bottom: 24px;
129
+ }
130
+ .message {
131
+ color: #4ade80;
132
+ margin: 16px 0;
133
+ font-size: 16px;
134
+ }
135
+ .note {
136
+ color: #6b7280;
137
+ font-size: 14px;
138
+ margin-top: 24px;
118
139
  }
119
- h1 { color: #10b981; margin: 0 0 16px 0; }
120
- p { color: #6b7280; margin: 0; }
121
140
  </style>
122
141
  </head>
123
142
  <body>
124
143
  <div class="container">
125
- <h1>✅ Authentication Complete!</h1>
126
- <p>You can close this window and return to your terminal.</p>
144
+ <div class="header">╔════════════════════════════════════════════════╗
145
+ ║ ✓ MENTAT SETUP COMPLETE ║
146
+ ╚════════════════════════════════════════════════╝</div>
147
+ <div class="message">$ Authentication successful</div>
148
+ <div class="note">// You can close this window and return to your terminal</div>
127
149
  </div>
128
150
  </body>
129
151
  </html>
130
152
  `);
131
153
 
132
154
  // Close server and resolve with token
133
- server.close();
134
- resolve(token);
155
+ server.close(() => {
156
+ resolve(token);
157
+ });
158
+ }
159
+ });
160
+
161
+ server.on('error', (err: any) => {
162
+ if (err.code === 'EADDRINUSE') {
163
+ reject(new Error(`Port ${SETUP_PORT} is already in use. Please close other applications and try again.`));
164
+ } else {
165
+ reject(err);
135
166
  }
136
167
  });
137
168
 
@@ -148,7 +179,7 @@ function startCallbackServer(): Promise<string> {
148
179
  // Timeout after 5 minutes
149
180
  setTimeout(() => {
150
181
  server.close();
151
- reject(new Error('Setup timed out after 5 minutes'));
182
+ reject(new Error('Setup timed out after 5 minutes. Please try again.'));
152
183
  }, 5 * 60 * 1000);
153
184
  });
154
185
  }
@@ -244,8 +275,18 @@ function openBrowser(url: string) {
244
275
  // Run setup
245
276
  setup().catch((error) => {
246
277
  console.error('');
247
- console.error('❌ Setup failed:', error.message);
278
+ console.error('╔════════════════════════════════════════════════╗');
279
+ console.error('║ ❌ SETUP FAILED ║');
280
+ console.error('╚════════════════════════════════════════════════╝');
281
+ console.error('');
282
+ console.error('Error:', error.message);
283
+ console.error('');
284
+ console.error('Common fixes:');
285
+ console.error(' • Make sure you\'re signed in at http://localhost:3000');
286
+ console.error(' • Check that port 3456 is not in use');
287
+ console.error(' • Try running the command again');
288
+ console.error('');
289
+ console.error('Need help? https://github.com/vgardrinier/mentat');
248
290
  console.error('');
249
- console.error('Need help? https://github.com/vgardrinier/a2a_marketplace');
250
291
  process.exit(1);
251
292
  });
package/src/skills.ts CHANGED
@@ -56,6 +56,7 @@ export class SkillLibrary {
56
56
 
57
57
  /**
58
58
  * Gather file context based on patterns or explicit files
59
+ * If explicit files are provided, patterns are ignored (respects user intent)
59
60
  */
60
61
  async gatherContext(
61
62
  patterns: string[] = [],
@@ -66,14 +67,17 @@ export class SkillLibrary {
66
67
  // Add explicit files
67
68
  explicitFiles.forEach((f) => filePaths.add(path.resolve(this.workspacePath, f)));
68
69
 
69
- // Add files matching patterns
70
- for (const pattern of patterns) {
71
- const matches = await glob(pattern, {
72
- cwd: this.workspacePath,
73
- absolute: true,
74
- ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**'],
75
- });
76
- matches.slice(0, LIMITS.maxFiles).forEach((f) => filePaths.add(f));
70
+ // Only use patterns if no explicit files were provided
71
+ // This prevents bloat when user specifies exact target files
72
+ if (filePaths.size === 0) {
73
+ for (const pattern of patterns) {
74
+ const matches = await glob(pattern, {
75
+ cwd: this.workspacePath,
76
+ absolute: true,
77
+ ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**'],
78
+ });
79
+ matches.slice(0, LIMITS.maxFiles).forEach((f) => filePaths.add(f));
80
+ }
77
81
  }
78
82
 
79
83
  // Rank and limit files