merlin-mcp 0.2.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.
- package/README.md +148 -0
- package/dist/api/client.d.ts +58 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +205 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/types.d.ts +100 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +5 -0
- package/dist/api/types.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +143 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +11 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +462 -0
- package/dist/server.js.map +1 -0
- package/dist/utils/git.d.ts +33 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +109 -0
- package/dist/utils/git.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# merlin-mcp
|
|
2
|
+
|
|
3
|
+
> MCP server that gives Claude Code instant access to your codebase context via merlin.build
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
Once installed, Claude Code automatically has deep understanding of any repository you've analyzed on [merlin.build](https://merlin.build):
|
|
8
|
+
|
|
9
|
+
- **No more re-explaining** your codebase every session
|
|
10
|
+
- **No more duplicating** code that already exists
|
|
11
|
+
- **No more guessing** at patterns and conventions
|
|
12
|
+
- **Instant context** for any task you're working on
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
### 1. Analyze Your Repository
|
|
17
|
+
|
|
18
|
+
Visit [merlin.build](https://merlin.build) and analyze your repository. This takes ~10 minutes and creates comprehensive documentation.
|
|
19
|
+
|
|
20
|
+
### 2. Get Your API Key
|
|
21
|
+
|
|
22
|
+
Go to [merlin.build/settings](https://merlin.build/settings) and generate an API key.
|
|
23
|
+
|
|
24
|
+
### 3. Configure Claude Code
|
|
25
|
+
|
|
26
|
+
Add to your Claude Code config (`~/.claude/config.json`):
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"merlin": {
|
|
32
|
+
"command": "npx",
|
|
33
|
+
"args": ["merlin-mcp"],
|
|
34
|
+
"env": {
|
|
35
|
+
"MERLIN_API_KEY": "your-api-key-here"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 4. Use It
|
|
43
|
+
|
|
44
|
+
Just start working. Claude Code now automatically has context:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
> "Add a new API endpoint for user settings"
|
|
48
|
+
|
|
49
|
+
Claude knows:
|
|
50
|
+
- Where your existing endpoints are
|
|
51
|
+
- What patterns they follow
|
|
52
|
+
- What middleware to use
|
|
53
|
+
- What utilities exist to reuse
|
|
54
|
+
- What conventions to follow
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Available Tools
|
|
58
|
+
|
|
59
|
+
Once connected, Claude Code has access to these tools:
|
|
60
|
+
|
|
61
|
+
| Tool | Description |
|
|
62
|
+
|------|-------------|
|
|
63
|
+
| `merlin_get_context` | Get relevant context for a task (patterns, files, conventions) |
|
|
64
|
+
| `merlin_find_files` | Find files by purpose or layer |
|
|
65
|
+
| `merlin_get_conventions` | Get coding conventions and anti-patterns |
|
|
66
|
+
| `merlin_quickstart` | Get a 60-second codebase overview |
|
|
67
|
+
| `merlin_search` | Search documentation for specific topics |
|
|
68
|
+
| `merlin_list_repos` | List your analyzed repositories |
|
|
69
|
+
|
|
70
|
+
## How It Works
|
|
71
|
+
|
|
72
|
+
1. **Auto-detection**: The MCP server detects which git repository you're in
|
|
73
|
+
2. **Lookup**: It finds the matching analyzed repo on merlin.build
|
|
74
|
+
3. **Context**: It provides relevant context to Claude Code
|
|
75
|
+
4. **Caching**: Responses are cached for fast repeat access
|
|
76
|
+
|
|
77
|
+
## Environment Variables
|
|
78
|
+
|
|
79
|
+
| Variable | Description | Default |
|
|
80
|
+
|----------|-------------|---------|
|
|
81
|
+
| `MERLIN_API_KEY` | Your Merlin API key | Required |
|
|
82
|
+
| `MERLIN_API_URL` | API base URL | `https://api.merlin.build` |
|
|
83
|
+
|
|
84
|
+
## Manual Usage
|
|
85
|
+
|
|
86
|
+
You can also run the server directly:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Show help
|
|
90
|
+
npx merlin-mcp --help
|
|
91
|
+
|
|
92
|
+
# Show version
|
|
93
|
+
npx merlin-mcp --version
|
|
94
|
+
|
|
95
|
+
# Run server (for testing)
|
|
96
|
+
MERLIN_API_KEY=xxx npx merlin-mcp
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Troubleshooting
|
|
100
|
+
|
|
101
|
+
### "Could not find repository"
|
|
102
|
+
|
|
103
|
+
This means either:
|
|
104
|
+
1. You're not in a git repository
|
|
105
|
+
2. The repository hasn't been analyzed on merlin.build
|
|
106
|
+
3. The git remote URL doesn't match what's on merlin
|
|
107
|
+
|
|
108
|
+
**Solution**: Make sure the repo is analyzed at merlin.build and you're in the repo directory.
|
|
109
|
+
|
|
110
|
+
### "API request failed: 401"
|
|
111
|
+
|
|
112
|
+
Your API key is invalid or expired.
|
|
113
|
+
|
|
114
|
+
**Solution**: Generate a new API key at merlin.build/settings.
|
|
115
|
+
|
|
116
|
+
### Server not starting
|
|
117
|
+
|
|
118
|
+
Check that Node.js 18+ is installed:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
node --version # Should be 18.x or higher
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Development
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Install dependencies
|
|
128
|
+
npm install
|
|
129
|
+
|
|
130
|
+
# Build
|
|
131
|
+
npm run build
|
|
132
|
+
|
|
133
|
+
# Run in development
|
|
134
|
+
npm run dev
|
|
135
|
+
|
|
136
|
+
# Type check
|
|
137
|
+
npm run typecheck
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
MIT
|
|
143
|
+
|
|
144
|
+
## Links
|
|
145
|
+
|
|
146
|
+
- [merlin.build](https://merlin.build) - Analyze your repositories
|
|
147
|
+
- [Documentation](https://merlin.build/docs) - Full documentation
|
|
148
|
+
- [GitHub](https://github.com/merlin/merlin) - Source code
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* merlin API Client
|
|
3
|
+
* Handles all HTTP requests to the merlin API with caching and error handling
|
|
4
|
+
*/
|
|
5
|
+
import type { Repository, AgentManifest, ConventionsResponse, FilesResponse } from './types.js';
|
|
6
|
+
/** API client configuration */
|
|
7
|
+
interface ClientConfig {
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Merlin API Client */
|
|
12
|
+
export declare class MerlinClient {
|
|
13
|
+
private config;
|
|
14
|
+
private cache;
|
|
15
|
+
private static MANIFEST_TTL;
|
|
16
|
+
private static CONVENTIONS_TTL;
|
|
17
|
+
private static REPOS_TTL;
|
|
18
|
+
private static FILES_TTL;
|
|
19
|
+
private static HOWTO_TTL;
|
|
20
|
+
constructor(config?: Partial<ClientConfig>);
|
|
21
|
+
/** Make an authenticated request to the API */
|
|
22
|
+
private fetch;
|
|
23
|
+
/** Get list of user's repositories */
|
|
24
|
+
getRepositories(): Promise<Repository[]>;
|
|
25
|
+
/** Find repository by GitHub URL */
|
|
26
|
+
findRepoByUrl(githubUrl: string): Promise<Repository | null>;
|
|
27
|
+
/** Get full manifest for a repository */
|
|
28
|
+
getManifest(repoId: string): Promise<AgentManifest>;
|
|
29
|
+
/** Get quickstart guide (text format) */
|
|
30
|
+
getQuickstart(repoId: string): Promise<string>;
|
|
31
|
+
/** Get main overview (text format) */
|
|
32
|
+
getOverview(repoId: string): Promise<string>;
|
|
33
|
+
/** Get conventions and anti-patterns */
|
|
34
|
+
getConventions(repoId: string): Promise<ConventionsResponse>;
|
|
35
|
+
/** Get files, optionally filtered by layer or purpose */
|
|
36
|
+
getFiles(repoId: string, options?: {
|
|
37
|
+
layer?: string;
|
|
38
|
+
purpose?: string;
|
|
39
|
+
}): Promise<FilesResponse>;
|
|
40
|
+
/** Find files by purpose (text format) */
|
|
41
|
+
findFiles(repoId: string, what: string): Promise<string>;
|
|
42
|
+
/** Search documentation */
|
|
43
|
+
search(repoId: string, query: string): Promise<string>;
|
|
44
|
+
/** Get how-to guide for a task */
|
|
45
|
+
getHowTo(repoId: string, task: string): Promise<string>;
|
|
46
|
+
/** Get impact analysis for a file - what depends on it */
|
|
47
|
+
getImpactAnalysis(repoId: string, filePath: string): Promise<string>;
|
|
48
|
+
/** Find similar code implementations */
|
|
49
|
+
getSimilarCode(repoId: string, description: string): Promise<string>;
|
|
50
|
+
/** Get code examples for common tasks */
|
|
51
|
+
getCodeExamples(repoId: string, task?: string): Promise<string>;
|
|
52
|
+
/** Clear all cached data */
|
|
53
|
+
clearCache(): void;
|
|
54
|
+
}
|
|
55
|
+
/** Get or create the API client instance */
|
|
56
|
+
export declare function getClient(): MerlinClient;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EACd,MAAM,YAAY,CAAC;AAQpB,+BAA+B;AAC/B,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4BD,wBAAwB;AACxB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,KAAK,CAAe;IAG5B,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AE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAU7D,0DAA0D;IACpD,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1E,wCAAwC;IAClC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1E,yCAAyC;IACnC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOrE,4BAA4B;IAC5B,UAAU,IAAI,IAAI;CAGnB;AAKD,4CAA4C;AAC5C,wBAAgB,SAAS,IAAI,YAAY,CAKxC"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* merlin API Client
|
|
3
|
+
* Handles all HTTP requests to the merlin API with caching and error handling
|
|
4
|
+
*/
|
|
5
|
+
/** Simple in-memory cache */
|
|
6
|
+
class Cache {
|
|
7
|
+
store = new Map();
|
|
8
|
+
get(key) {
|
|
9
|
+
const entry = this.store.get(key);
|
|
10
|
+
if (!entry)
|
|
11
|
+
return null;
|
|
12
|
+
if (Date.now() > entry.expiresAt) {
|
|
13
|
+
this.store.delete(key);
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return entry.data;
|
|
17
|
+
}
|
|
18
|
+
set(key, data, ttlMs) {
|
|
19
|
+
this.store.set(key, {
|
|
20
|
+
data,
|
|
21
|
+
expiresAt: Date.now() + ttlMs,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
clear() {
|
|
25
|
+
this.store.clear();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Merlin API Client */
|
|
29
|
+
export class MerlinClient {
|
|
30
|
+
config;
|
|
31
|
+
cache = new Cache();
|
|
32
|
+
// Cache TTLs - short for real-time updates
|
|
33
|
+
static MANIFEST_TTL = 60 * 1000; // 1 minute (wiki updates every 5 min)
|
|
34
|
+
static CONVENTIONS_TTL = 5 * 60 * 1000; // 5 minutes
|
|
35
|
+
static REPOS_TTL = 30 * 1000; // 30 seconds (for share changes)
|
|
36
|
+
static FILES_TTL = 60 * 1000; // 1 minute (files rarely change mid-session)
|
|
37
|
+
static HOWTO_TTL = 2 * 60 * 1000; // 2 minutes (smart how-to has server-side cache too)
|
|
38
|
+
constructor(config = {}) {
|
|
39
|
+
this.config = {
|
|
40
|
+
baseUrl: config.baseUrl || process.env.MERLIN_API_URL || 'https://claude-codeapi-production.up.railway.app',
|
|
41
|
+
apiKey: config.apiKey || process.env.MERLIN_API_KEY,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Make an authenticated request to the API */
|
|
45
|
+
async fetch(path, options = {}) {
|
|
46
|
+
const url = `${this.config.baseUrl}${path}`;
|
|
47
|
+
const headers = {
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
'User-Agent': 'merlin-mcp/0.1.0',
|
|
50
|
+
...(options.headers || {}),
|
|
51
|
+
};
|
|
52
|
+
// Add API key if available
|
|
53
|
+
if (this.config.apiKey) {
|
|
54
|
+
headers['Authorization'] = `Bearer ${this.config.apiKey}`;
|
|
55
|
+
}
|
|
56
|
+
const response = await fetch(url, {
|
|
57
|
+
...options,
|
|
58
|
+
headers,
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
const errorText = await response.text().catch(() => 'Unknown error');
|
|
62
|
+
throw new Error(`API request failed: ${response.status} ${response.statusText} - ${errorText}`);
|
|
63
|
+
}
|
|
64
|
+
// Handle both JSON and text responses
|
|
65
|
+
const contentType = response.headers.get('content-type');
|
|
66
|
+
if (contentType?.includes('application/json')) {
|
|
67
|
+
return response.json();
|
|
68
|
+
}
|
|
69
|
+
return response.text();
|
|
70
|
+
}
|
|
71
|
+
/** Get list of user's repositories */
|
|
72
|
+
async getRepositories() {
|
|
73
|
+
const cacheKey = 'repos';
|
|
74
|
+
const cached = this.cache.get(cacheKey);
|
|
75
|
+
if (cached)
|
|
76
|
+
return cached;
|
|
77
|
+
const response = await this.fetch('/api/repos/my/list');
|
|
78
|
+
const repos = response.repositories || [];
|
|
79
|
+
this.cache.set(cacheKey, repos, MerlinClient.REPOS_TTL);
|
|
80
|
+
return repos;
|
|
81
|
+
}
|
|
82
|
+
/** Find repository by GitHub URL */
|
|
83
|
+
async findRepoByUrl(githubUrl) {
|
|
84
|
+
const repos = await this.getRepositories();
|
|
85
|
+
// Normalize URL for comparison
|
|
86
|
+
const normalizeUrl = (url) => {
|
|
87
|
+
return url
|
|
88
|
+
.replace(/^https?:\/\//, '')
|
|
89
|
+
.replace(/^github\.com\//, '')
|
|
90
|
+
.replace(/\.git$/, '')
|
|
91
|
+
.toLowerCase();
|
|
92
|
+
};
|
|
93
|
+
const normalizedTarget = normalizeUrl(githubUrl);
|
|
94
|
+
return repos.find(repo => {
|
|
95
|
+
const normalizedRepo = normalizeUrl(repo.url);
|
|
96
|
+
return normalizedRepo === normalizedTarget ||
|
|
97
|
+
normalizedRepo.includes(normalizedTarget) ||
|
|
98
|
+
normalizedTarget.includes(normalizedRepo);
|
|
99
|
+
}) || null;
|
|
100
|
+
}
|
|
101
|
+
/** Get full manifest for a repository */
|
|
102
|
+
async getManifest(repoId) {
|
|
103
|
+
const cacheKey = `manifest:${repoId}`;
|
|
104
|
+
const cached = this.cache.get(cacheKey);
|
|
105
|
+
if (cached)
|
|
106
|
+
return cached;
|
|
107
|
+
const manifest = await this.fetch(`/api/agent/${repoId}/manifest`);
|
|
108
|
+
this.cache.set(cacheKey, manifest, MerlinClient.MANIFEST_TTL);
|
|
109
|
+
return manifest;
|
|
110
|
+
}
|
|
111
|
+
/** Get quickstart guide (text format) */
|
|
112
|
+
async getQuickstart(repoId) {
|
|
113
|
+
const cacheKey = `quickstart:${repoId}`;
|
|
114
|
+
const cached = this.cache.get(cacheKey);
|
|
115
|
+
if (cached)
|
|
116
|
+
return cached;
|
|
117
|
+
const quickstart = await this.fetch(`/api/agent/${repoId}/quickstart`);
|
|
118
|
+
this.cache.set(cacheKey, quickstart, MerlinClient.MANIFEST_TTL);
|
|
119
|
+
return quickstart;
|
|
120
|
+
}
|
|
121
|
+
/** Get main overview (text format) */
|
|
122
|
+
async getOverview(repoId) {
|
|
123
|
+
const cacheKey = `overview:${repoId}`;
|
|
124
|
+
const cached = this.cache.get(cacheKey);
|
|
125
|
+
if (cached)
|
|
126
|
+
return cached;
|
|
127
|
+
const overview = await this.fetch(`/api/agent/${repoId}`);
|
|
128
|
+
this.cache.set(cacheKey, overview, MerlinClient.MANIFEST_TTL);
|
|
129
|
+
return overview;
|
|
130
|
+
}
|
|
131
|
+
/** Get conventions and anti-patterns */
|
|
132
|
+
async getConventions(repoId) {
|
|
133
|
+
const cacheKey = `conventions:${repoId}`;
|
|
134
|
+
const cached = this.cache.get(cacheKey);
|
|
135
|
+
if (cached)
|
|
136
|
+
return cached;
|
|
137
|
+
const conventions = await this.fetch(`/api/agent/${repoId}/manifest/conventions`);
|
|
138
|
+
this.cache.set(cacheKey, conventions, MerlinClient.CONVENTIONS_TTL);
|
|
139
|
+
return conventions;
|
|
140
|
+
}
|
|
141
|
+
/** Get files, optionally filtered by layer or purpose */
|
|
142
|
+
async getFiles(repoId, options = {}) {
|
|
143
|
+
const params = new URLSearchParams();
|
|
144
|
+
if (options.layer)
|
|
145
|
+
params.set('layer', options.layer);
|
|
146
|
+
if (options.purpose)
|
|
147
|
+
params.set('purpose', options.purpose);
|
|
148
|
+
const queryString = params.toString();
|
|
149
|
+
const cacheKey = `files:${repoId}:${queryString}`;
|
|
150
|
+
const cached = this.cache.get(cacheKey);
|
|
151
|
+
if (cached)
|
|
152
|
+
return cached;
|
|
153
|
+
const path = `/api/agent/${repoId}/manifest/files${queryString ? `?${queryString}` : ''}`;
|
|
154
|
+
const files = await this.fetch(path);
|
|
155
|
+
this.cache.set(cacheKey, files, MerlinClient.FILES_TTL);
|
|
156
|
+
return files;
|
|
157
|
+
}
|
|
158
|
+
/** Find files by purpose (text format) */
|
|
159
|
+
async findFiles(repoId, what) {
|
|
160
|
+
return this.fetch(`/api/agent/${repoId}/find/${encodeURIComponent(what)}`);
|
|
161
|
+
}
|
|
162
|
+
/** Search documentation */
|
|
163
|
+
async search(repoId, query) {
|
|
164
|
+
return this.fetch(`/api/agent/${repoId}/search?q=${encodeURIComponent(query)}`);
|
|
165
|
+
}
|
|
166
|
+
/** Get how-to guide for a task */
|
|
167
|
+
async getHowTo(repoId, task) {
|
|
168
|
+
const cacheKey = `howto:${repoId}:${task.toLowerCase().trim()}`;
|
|
169
|
+
const cached = this.cache.get(cacheKey);
|
|
170
|
+
if (cached)
|
|
171
|
+
return cached;
|
|
172
|
+
const howto = await this.fetch(`/api/agent/${repoId}/howto?task=${encodeURIComponent(task)}`);
|
|
173
|
+
this.cache.set(cacheKey, howto, MerlinClient.HOWTO_TTL);
|
|
174
|
+
return howto;
|
|
175
|
+
}
|
|
176
|
+
/** Get impact analysis for a file - what depends on it */
|
|
177
|
+
async getImpactAnalysis(repoId, filePath) {
|
|
178
|
+
return this.fetch(`/api/agent/${repoId}/impact/${encodeURIComponent(filePath)}`);
|
|
179
|
+
}
|
|
180
|
+
/** Find similar code implementations */
|
|
181
|
+
async getSimilarCode(repoId, description) {
|
|
182
|
+
return this.fetch(`/api/agent/${repoId}/similar?q=${encodeURIComponent(description)}`);
|
|
183
|
+
}
|
|
184
|
+
/** Get code examples for common tasks */
|
|
185
|
+
async getCodeExamples(repoId, task) {
|
|
186
|
+
const path = task
|
|
187
|
+
? `/api/agent/${repoId}/examples/${encodeURIComponent(task)}`
|
|
188
|
+
: `/api/agent/${repoId}/examples`;
|
|
189
|
+
return this.fetch(path);
|
|
190
|
+
}
|
|
191
|
+
/** Clear all cached data */
|
|
192
|
+
clearCache() {
|
|
193
|
+
this.cache.clear();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/** Singleton instance */
|
|
197
|
+
let clientInstance = null;
|
|
198
|
+
/** Get or create the API client instance */
|
|
199
|
+
export function getClient() {
|
|
200
|
+
if (!clientInstance) {
|
|
201
|
+
clientInstance = new MerlinClient();
|
|
202
|
+
}
|
|
203
|
+
return clientInstance;
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,6BAA6B;AAC7B,MAAM,KAAK;IACD,KAAK,GAAG,IAAI,GAAG,EAA+B,CAAC;IAEvD,GAAG,CAAI,GAAW;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC,IAAS,CAAC;IACzB,CAAC;IAED,GAAG,CAAI,GAAW,EAAE,IAAO,EAAE,KAAa;QACxC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;YAClB,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF;AAED,wBAAwB;AACxB,MAAM,OAAO,YAAY;IACf,MAAM,CAAe;IACrB,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;IAE5B,2CAA2C;IACnC,MAAM,CAAC,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,sCAAsC;IACvE,MAAM,CAAC,eAAe,GAAG,CAAC,GAAG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
|
+
/** Repository info from /api/repos */
|
|
5
|
+
export interface Repository {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
fullName: string;
|
|
9
|
+
url: string;
|
|
10
|
+
branch: string;
|
|
11
|
+
status: 'pending' | 'analyzing' | 'completed' | 'failed';
|
|
12
|
+
lastAnalyzedAt?: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
}
|
|
15
|
+
/** File info from manifest */
|
|
16
|
+
export interface FileInfo {
|
|
17
|
+
path: string;
|
|
18
|
+
purpose: string;
|
|
19
|
+
exports: Array<{
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
}>;
|
|
23
|
+
modifyFor: string[];
|
|
24
|
+
layer: string;
|
|
25
|
+
}
|
|
26
|
+
/** Convention from manifest */
|
|
27
|
+
export interface Convention {
|
|
28
|
+
category: string;
|
|
29
|
+
rule: string;
|
|
30
|
+
example: string;
|
|
31
|
+
exampleFiles: string[];
|
|
32
|
+
enforcement: string;
|
|
33
|
+
}
|
|
34
|
+
/** Anti-pattern from manifest */
|
|
35
|
+
export interface AntiPattern {
|
|
36
|
+
pattern: string;
|
|
37
|
+
reason: string;
|
|
38
|
+
instead: string;
|
|
39
|
+
severity: 'error' | 'warning';
|
|
40
|
+
}
|
|
41
|
+
/** Change guide step */
|
|
42
|
+
export interface ChangeStep {
|
|
43
|
+
order: number;
|
|
44
|
+
file: string;
|
|
45
|
+
action: string;
|
|
46
|
+
description: string;
|
|
47
|
+
pattern: string;
|
|
48
|
+
}
|
|
49
|
+
/** Change guide from manifest */
|
|
50
|
+
export interface ChangeGuide {
|
|
51
|
+
task: string;
|
|
52
|
+
description: string;
|
|
53
|
+
steps: ChangeStep[];
|
|
54
|
+
affectedFiles: string[];
|
|
55
|
+
conventions: string[];
|
|
56
|
+
}
|
|
57
|
+
/** Entry point from manifest */
|
|
58
|
+
export interface EntryPoint {
|
|
59
|
+
name: string;
|
|
60
|
+
path: string;
|
|
61
|
+
purpose: string;
|
|
62
|
+
useCase: string;
|
|
63
|
+
relatedFiles: string[];
|
|
64
|
+
}
|
|
65
|
+
/** Full agent manifest response */
|
|
66
|
+
export interface AgentManifest {
|
|
67
|
+
projectName: string;
|
|
68
|
+
description: string;
|
|
69
|
+
techStack: string[];
|
|
70
|
+
architecture: string;
|
|
71
|
+
entryPoints: EntryPoint[];
|
|
72
|
+
fileIndex: FileInfo[];
|
|
73
|
+
conventions: Convention[];
|
|
74
|
+
antiPatterns: AntiPattern[];
|
|
75
|
+
changeGuides: ChangeGuide[];
|
|
76
|
+
modules: Array<{
|
|
77
|
+
name: string;
|
|
78
|
+
path: string;
|
|
79
|
+
description: string;
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
/** Search result */
|
|
83
|
+
export interface SearchResult {
|
|
84
|
+
type: 'SERVICE' | 'MODULE' | 'TERM' | 'FILE';
|
|
85
|
+
name: string;
|
|
86
|
+
description: string;
|
|
87
|
+
path?: string;
|
|
88
|
+
}
|
|
89
|
+
/** Conventions response */
|
|
90
|
+
export interface ConventionsResponse {
|
|
91
|
+
conventions: Convention[];
|
|
92
|
+
antiPatterns: AntiPattern[];
|
|
93
|
+
changeGuides: ChangeGuide[];
|
|
94
|
+
}
|
|
95
|
+
/** Files response */
|
|
96
|
+
export interface FilesResponse {
|
|
97
|
+
count: number;
|
|
98
|
+
files: FileInfo[];
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,sCAAsC;AACtC,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,WA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|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Merlin MCP Server - Entry Point
|
|
4
|
+
*
|
|
5
|
+
* AI-powered codebase intelligence for coding agents.
|
|
6
|
+
* https://merlin.build
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx merlin-mcp
|
|
10
|
+
* MERLIN_API_KEY=xxx npx merlin-mcp
|
|
11
|
+
*
|
|
12
|
+
* Configuration (via environment variables):
|
|
13
|
+
* MERLIN_API_KEY - Your Merlin API key (required for private repos)
|
|
14
|
+
* MERLIN_API_URL - API base URL (default: https://api.merlin.build)
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}
|