@reposit-bot/reposit-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.
- package/dist/api.d.ts +31 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +69 -0
- package/dist/api.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +78 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface Solution {
|
|
2
|
+
id: string;
|
|
3
|
+
problem: string;
|
|
4
|
+
solution: string;
|
|
5
|
+
tags: string[];
|
|
6
|
+
score: number;
|
|
7
|
+
created_at: string;
|
|
8
|
+
updated_at: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SearchResult {
|
|
11
|
+
solutions: Solution[];
|
|
12
|
+
total: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class RepositClient {
|
|
15
|
+
private baseUrl;
|
|
16
|
+
private token?;
|
|
17
|
+
constructor(baseUrl: string, token?: string | undefined);
|
|
18
|
+
search(query: string, options?: {
|
|
19
|
+
tags?: string[];
|
|
20
|
+
limit?: number;
|
|
21
|
+
}): Promise<SearchResult>;
|
|
22
|
+
share(problem: string, solution: string, tags?: string[]): Promise<Solution>;
|
|
23
|
+
upvote(id: string): Promise<{
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
downvote(id: string, reason: string, comment?: string): Promise<{
|
|
27
|
+
message: string;
|
|
28
|
+
}>;
|
|
29
|
+
private request;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA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
|
+
async search(query, options = {}) {
|
|
9
|
+
const params = new URLSearchParams({ q: query });
|
|
10
|
+
if (options.tags?.length) {
|
|
11
|
+
params.set("tags", options.tags.join(","));
|
|
12
|
+
}
|
|
13
|
+
if (options.limit) {
|
|
14
|
+
params.set("limit", String(options.limit));
|
|
15
|
+
}
|
|
16
|
+
const response = await this.request(`/api/v1/solutions/search?${params}`);
|
|
17
|
+
return response.data;
|
|
18
|
+
}
|
|
19
|
+
async share(problem, solution, tags) {
|
|
20
|
+
const response = await this.request("/api/v1/solutions", {
|
|
21
|
+
method: "POST",
|
|
22
|
+
body: JSON.stringify({ problem, solution, tags: tags ?? [] }),
|
|
23
|
+
});
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
async upvote(id) {
|
|
27
|
+
const response = await this.request(`/api/v1/solutions/${id}/upvote`, { method: "POST" });
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
async downvote(id, reason, comment) {
|
|
31
|
+
const response = await this.request(`/api/v1/solutions/${id}/downvote`, {
|
|
32
|
+
method: "POST",
|
|
33
|
+
body: JSON.stringify({ reason, comment }),
|
|
34
|
+
});
|
|
35
|
+
return response.data;
|
|
36
|
+
}
|
|
37
|
+
async request(path, options = {}) {
|
|
38
|
+
const url = new URL(path, this.baseUrl);
|
|
39
|
+
const headers = {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
};
|
|
42
|
+
if (this.token) {
|
|
43
|
+
headers["Authorization"] = `Bearer ${this.token}`;
|
|
44
|
+
}
|
|
45
|
+
const response = await fetch(url, {
|
|
46
|
+
...options,
|
|
47
|
+
headers: {
|
|
48
|
+
...headers,
|
|
49
|
+
...options.headers,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
const body = await response.text();
|
|
54
|
+
let message = `HTTP ${response.status}`;
|
|
55
|
+
try {
|
|
56
|
+
const json = JSON.parse(body);
|
|
57
|
+
if (json.error)
|
|
58
|
+
message = json.error;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
if (body)
|
|
62
|
+
message = body;
|
|
63
|
+
}
|
|
64
|
+
throw new Error(message);
|
|
65
|
+
}
|
|
66
|
+
return response.json();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAeA,MAAM,OAAO,aAAa;IAEd;IACA;IAFV,YACU,OAAe,EACf,KAAc;QADd,YAAO,GAAP,OAAO,CAAQ;QACf,UAAK,GAAL,KAAK,CAAS;IACrB,CAAC;IAEJ,KAAK,CAAC,MAAM,CACV,KAAa,EACb,UAA+C,EAAE;QAEjD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACjD,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC,4BAA4B,MAAM,EAAE,CACrC,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,KAAK,CACT,OAAe,EACf,QAAgB,EAChB,IAAe;QAEf,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC,mBAAmB,EACnB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC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,CAAC,IAAI,EAAE,CAAC;YACnC,IAAI,OAAO,GAAG,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC;YACxC,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC9B,IAAI,IAAI,CAAC,KAAK;oBAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;YACvC,CAAC;YAAC,MAAM,CAAC;gBACP,IAAI,IAAI;oBAAE,OAAO,GAAG,IAAI,CAAC;YAC3B,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACF"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface BackendConfig {
|
|
2
|
+
url: string;
|
|
3
|
+
token?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RepositConfig {
|
|
6
|
+
backends: Record<string, BackendConfig>;
|
|
7
|
+
default?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function loadConfig(): RepositConfig;
|
|
10
|
+
export declare function getBackends(config: RepositConfig, names?: string | string[]): {
|
|
11
|
+
name: string;
|
|
12
|
+
backend: BackendConfig;
|
|
13
|
+
}[];
|
|
14
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA8BD,wBAAgB,UAAU,IAAI,aAAa,CA2B1C;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,EAAE,CA8B5C"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
const GLOBAL_CONFIG_PATH = join(homedir(), ".reposit", "config.json");
|
|
5
|
+
const LOCAL_CONFIG_PATH = ".reposit.json";
|
|
6
|
+
function loadJsonFile(path) {
|
|
7
|
+
if (!existsSync(path))
|
|
8
|
+
return null;
|
|
9
|
+
try {
|
|
10
|
+
const content = readFileSync(path, "utf-8");
|
|
11
|
+
return JSON.parse(content);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function parseEnvBackends() {
|
|
18
|
+
const env = process.env.REPOSIT_BACKENDS;
|
|
19
|
+
if (!env)
|
|
20
|
+
return null;
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(env);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// Default backend for zero-config local development
|
|
29
|
+
const DEFAULT_LOCAL_BACKEND = {
|
|
30
|
+
url: "http://localhost:4000",
|
|
31
|
+
};
|
|
32
|
+
export function loadConfig() {
|
|
33
|
+
const globalConfig = loadJsonFile(GLOBAL_CONFIG_PATH);
|
|
34
|
+
const localConfig = loadJsonFile(LOCAL_CONFIG_PATH);
|
|
35
|
+
const envBackends = parseEnvBackends();
|
|
36
|
+
// Merge: global -> local -> env (later wins)
|
|
37
|
+
const backends = {
|
|
38
|
+
...(globalConfig?.backends ?? {}),
|
|
39
|
+
...(localConfig?.backends ?? {}),
|
|
40
|
+
...(envBackends ?? {}),
|
|
41
|
+
};
|
|
42
|
+
// Single REPOSIT_URL env var adds/overrides "local" backend
|
|
43
|
+
if (process.env.REPOSIT_URL) {
|
|
44
|
+
backends["local"] = { url: process.env.REPOSIT_URL };
|
|
45
|
+
}
|
|
46
|
+
// If no backends configured at all, use default local backend
|
|
47
|
+
if (Object.keys(backends).length === 0) {
|
|
48
|
+
backends["local"] = DEFAULT_LOCAL_BACKEND;
|
|
49
|
+
}
|
|
50
|
+
// Determine default backend
|
|
51
|
+
const defaultBackend = localConfig?.default ?? globalConfig?.default ?? Object.keys(backends)[0];
|
|
52
|
+
return { backends, default: defaultBackend };
|
|
53
|
+
}
|
|
54
|
+
export function getBackends(config, names) {
|
|
55
|
+
if (!names) {
|
|
56
|
+
// Use default
|
|
57
|
+
const name = config.default;
|
|
58
|
+
if (!name || !config.backends[name]) {
|
|
59
|
+
throw new Error(`No default backend configured. Available: ${Object.keys(config.backends).join(", ") || "none"}`);
|
|
60
|
+
}
|
|
61
|
+
return [{ name, backend: config.backends[name] }];
|
|
62
|
+
}
|
|
63
|
+
const nameList = Array.isArray(names) ? names : [names];
|
|
64
|
+
if (nameList.includes("all")) {
|
|
65
|
+
return Object.entries(config.backends).map(([name, backend]) => ({
|
|
66
|
+
name,
|
|
67
|
+
backend,
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
return nameList.map((name) => {
|
|
71
|
+
const backend = config.backends[name];
|
|
72
|
+
if (!backend) {
|
|
73
|
+
throw new Error(`Backend "${name}" not found. Available: ${Object.keys(config.backends).join(", ") || "none"}`);
|
|
74
|
+
}
|
|
75
|
+
return { name, backend };
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAA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C,KAAK,CAAC,CAAC;IAExD,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/D,IAAI;YACJ,OAAO;SACR,CAAC,CAAC,CAAC;IACN,CAAC;IAED,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACb,YAAY,IAAI,2BAA2B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { ListToolsRequestSchema, CallToolRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { RepositClient } from "./api.js";
|
|
6
|
+
import { loadConfig, getBackends } from "./config.js";
|
|
7
|
+
const config = loadConfig();
|
|
8
|
+
function getClient(backendName) {
|
|
9
|
+
const backend = config.backends[backendName];
|
|
10
|
+
if (!backend) {
|
|
11
|
+
throw new Error(`Backend "${backendName}" not configured`);
|
|
12
|
+
}
|
|
13
|
+
return new RepositClient(backend.url, backend.token);
|
|
14
|
+
}
|
|
15
|
+
function describeBackends(config) {
|
|
16
|
+
const names = Object.keys(config.backends);
|
|
17
|
+
if (names.length === 0)
|
|
18
|
+
return "No backends configured";
|
|
19
|
+
const defaultMarker = (n) => (n === config.default ? " (default)" : "");
|
|
20
|
+
return names.map((n) => `${n}${defaultMarker(n)}`).join(", ");
|
|
21
|
+
}
|
|
22
|
+
const server = new Server({ name: "reposit-mcp", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
23
|
+
const backendDescription = `Backend(s) to query. Can be a single name, array of names, or "all". Available: ${describeBackends(config)}`;
|
|
24
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
25
|
+
return {
|
|
26
|
+
tools: [
|
|
27
|
+
{
|
|
28
|
+
name: "search",
|
|
29
|
+
description: "Search for solutions in the Reposit knowledge base. Returns matching problems and their solutions. Can search multiple backends.",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
query: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Search query to find relevant solutions",
|
|
36
|
+
},
|
|
37
|
+
backend: {
|
|
38
|
+
oneOf: [
|
|
39
|
+
{ type: "string" },
|
|
40
|
+
{ type: "array", items: { type: "string" } },
|
|
41
|
+
],
|
|
42
|
+
description: backendDescription,
|
|
43
|
+
},
|
|
44
|
+
tags: {
|
|
45
|
+
type: "array",
|
|
46
|
+
items: { type: "string" },
|
|
47
|
+
description: "Optional tags to filter results",
|
|
48
|
+
},
|
|
49
|
+
limit: {
|
|
50
|
+
type: "number",
|
|
51
|
+
description: "Maximum number of results per backend (default: 10)",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
required: ["query"],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "share",
|
|
59
|
+
description: "Share a new solution with the Reposit community. Use this when you've solved a problem that others might benefit from.",
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: "object",
|
|
62
|
+
properties: {
|
|
63
|
+
problem: {
|
|
64
|
+
type: "string",
|
|
65
|
+
description: "Description of the problem that was solved",
|
|
66
|
+
},
|
|
67
|
+
solution: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "The solution to the problem",
|
|
70
|
+
},
|
|
71
|
+
backend: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: backendDescription,
|
|
74
|
+
},
|
|
75
|
+
tags: {
|
|
76
|
+
type: "array",
|
|
77
|
+
items: { type: "string" },
|
|
78
|
+
description: "Tags to categorize the solution",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
required: ["problem", "solution"],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "vote_up",
|
|
86
|
+
description: "Upvote a solution that was helpful. This helps surface good solutions to others.",
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
id: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "The ID of the solution to upvote",
|
|
93
|
+
},
|
|
94
|
+
backend: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: backendDescription,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ["id"],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "vote_down",
|
|
104
|
+
description: "Downvote a solution that was incorrect, outdated, or unhelpful. Requires a reason.",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
id: {
|
|
109
|
+
type: "string",
|
|
110
|
+
description: "The ID of the solution to downvote",
|
|
111
|
+
},
|
|
112
|
+
backend: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: backendDescription,
|
|
115
|
+
},
|
|
116
|
+
reason: {
|
|
117
|
+
type: "string",
|
|
118
|
+
enum: [
|
|
119
|
+
"incorrect",
|
|
120
|
+
"outdated",
|
|
121
|
+
"incomplete",
|
|
122
|
+
"harmful",
|
|
123
|
+
"duplicate",
|
|
124
|
+
"other",
|
|
125
|
+
],
|
|
126
|
+
description: "Reason for the downvote",
|
|
127
|
+
},
|
|
128
|
+
comment: {
|
|
129
|
+
type: "string",
|
|
130
|
+
description: "Optional comment explaining the downvote",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
required: ["id", "reason"],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "list_backends",
|
|
138
|
+
description: "List all configured Reposit backends.",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
148
|
+
const { name, arguments: args } = request.params;
|
|
149
|
+
try {
|
|
150
|
+
switch (name) {
|
|
151
|
+
case "search": {
|
|
152
|
+
const { query, backend, tags, limit } = args;
|
|
153
|
+
const backends = getBackends(config, backend);
|
|
154
|
+
const results = [];
|
|
155
|
+
await Promise.all(backends.map(async ({ name: backendName, backend: backendConfig }) => {
|
|
156
|
+
const client = new RepositClient(backendConfig.url, backendConfig.token);
|
|
157
|
+
const result = await client.search(query, { tags, limit });
|
|
158
|
+
results.push({
|
|
159
|
+
backend: backendName,
|
|
160
|
+
solutions: result.solutions,
|
|
161
|
+
total: result.total,
|
|
162
|
+
});
|
|
163
|
+
}));
|
|
164
|
+
return {
|
|
165
|
+
content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
case "share": {
|
|
169
|
+
const { problem, solution, backend, tags } = args;
|
|
170
|
+
const [{ name: backendName }] = getBackends(config, backend);
|
|
171
|
+
const client = getClient(backendName);
|
|
172
|
+
const result = await client.share(problem, solution, tags);
|
|
173
|
+
return {
|
|
174
|
+
content: [
|
|
175
|
+
{
|
|
176
|
+
type: "text",
|
|
177
|
+
text: JSON.stringify({ backend: backendName, ...result }, null, 2),
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
case "vote_up": {
|
|
183
|
+
const { id, backend } = args;
|
|
184
|
+
const [{ name: backendName }] = getBackends(config, backend);
|
|
185
|
+
const client = getClient(backendName);
|
|
186
|
+
const result = await client.upvote(id);
|
|
187
|
+
return {
|
|
188
|
+
content: [
|
|
189
|
+
{
|
|
190
|
+
type: "text",
|
|
191
|
+
text: JSON.stringify({ backend: backendName, ...result }, null, 2),
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
case "vote_down": {
|
|
197
|
+
const { id, backend, reason, comment } = args;
|
|
198
|
+
const [{ name: backendName }] = getBackends(config, backend);
|
|
199
|
+
const client = getClient(backendName);
|
|
200
|
+
const result = await client.downvote(id, reason, comment);
|
|
201
|
+
return {
|
|
202
|
+
content: [
|
|
203
|
+
{
|
|
204
|
+
type: "text",
|
|
205
|
+
text: JSON.stringify({ backend: backendName, ...result }, null, 2),
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
case "list_backends": {
|
|
211
|
+
const backends = Object.entries(config.backends).map(([name, cfg]) => ({
|
|
212
|
+
name,
|
|
213
|
+
url: cfg.url,
|
|
214
|
+
isDefault: name === config.default,
|
|
215
|
+
}));
|
|
216
|
+
return {
|
|
217
|
+
content: [{ type: "text", text: JSON.stringify(backends, null, 2) }],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
default:
|
|
221
|
+
return {
|
|
222
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
223
|
+
isError: true,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
229
|
+
return {
|
|
230
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
231
|
+
isError: true,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
async function main() {
|
|
236
|
+
const transport = new StdioServerTransport();
|
|
237
|
+
await server.connect(transport);
|
|
238
|
+
const backendInfo = describeBackends(config);
|
|
239
|
+
console.error(`Reposit MCP server running. Backends: ${backendInfo}`);
|
|
240
|
+
}
|
|
241
|
+
main().catch((error) => {
|
|
242
|
+
console.error("Fatal error:", error);
|
|
243
|
+
process.exit(1);
|
|
244
|
+
});
|
|
245
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GAEtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAE1E,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;AAE5B,SAAS,SAAS,CAAC,WAAmB;IACpC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,YAAY,WAAW,kBAAkB,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAqB;IAC7C,MAAM,KAAK,GAAG,MAAM,CA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C,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reposit-bot/reposit-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Reposit - community knowledge sharing for AI agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"reposit-mcp": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "tsc --watch",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"typecheck": "tsc --noEmit",
|
|
14
|
+
"clean": "rm -rf dist"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"mcp",
|
|
21
|
+
"model-context-protocol",
|
|
22
|
+
"reposit",
|
|
23
|
+
"claude",
|
|
24
|
+
"ai"
|
|
25
|
+
],
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/reposit-bot/reposit-mcp"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^22.0.0",
|
|
39
|
+
"typescript": "^5.7.0"
|
|
40
|
+
}
|
|
41
|
+
}
|