@oss-autopilot/mcp 1.0.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,15 @@
1
+ /**
2
+ * MCP prompt registrations for OSS Autopilot.
3
+ *
4
+ * Registers pre-built prompt workflows that combine tool invocations
5
+ * with structured user messages for common contribution tasks:
6
+ * - triage: Daily PR triage and prioritization
7
+ * - respond-to-pr: Draft responses to maintainer feedback
8
+ * - find-issues: Discover and rank contributable issues
9
+ */
10
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
11
+ /**
12
+ * Registers all OSS Autopilot MCP prompts on the given server.
13
+ */
14
+ export declare function registerPrompts(server: McpServer): void;
15
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiBzE;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyEvD"}
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod';
2
+ import { runDaily, runComments, runSearch } from '@oss-autopilot/core/commands';
3
+ import { errorMessage } from './tools.js';
4
+ /** Build a single-message prompt result with a user text message. */
5
+ function userMessage(text) {
6
+ return {
7
+ messages: [
8
+ {
9
+ role: 'user',
10
+ content: { type: 'text', text },
11
+ },
12
+ ],
13
+ };
14
+ }
15
+ /**
16
+ * Registers all OSS Autopilot MCP prompts on the given server.
17
+ */
18
+ export function registerPrompts(server) {
19
+ // 1. triage — no args, runs daily check and builds triage message
20
+ server.registerPrompt('triage', {
21
+ title: 'Triage PRs',
22
+ description: 'Get a prioritized list of PRs needing attention with recommended actions',
23
+ }, async () => {
24
+ try {
25
+ const data = await runDaily();
26
+ return userMessage(`Here is my current OSS contribution status. Help me triage and prioritize:\n\n${data.summary}\n\nActionable issues:\n${JSON.stringify(data.actionableIssues, null, 2)}\n\nFull data:\n${JSON.stringify(data.digest, null, 2)}`);
27
+ }
28
+ catch (e) {
29
+ console.error('[MCP] Prompt error (triage):', e);
30
+ return userMessage(`Failed to fetch triage data: ${errorMessage(e)}`);
31
+ }
32
+ });
33
+ // 2. respond-to-pr — requires prUrl, fetches PR comments for drafting a response
34
+ server.registerPrompt('respond-to-pr', {
35
+ title: 'Respond to PR',
36
+ description: 'Get context for a PR to help draft a response to maintainer feedback',
37
+ argsSchema: {
38
+ prUrl: z.string().url().describe('GitHub PR URL to respond to'),
39
+ },
40
+ }, async ({ prUrl }) => {
41
+ try {
42
+ const data = await runComments({ prUrl });
43
+ return userMessage(`Help me respond to this pull request:\n\nPR: ${data.pr.title} (${data.pr.url})\nState: ${data.pr.state}\n\nReviews:\n${JSON.stringify(data.reviews, null, 2)}\n\nInline comments:\n${JSON.stringify(data.reviewComments, null, 2)}\n\nDiscussion:\n${JSON.stringify(data.issueComments, null, 2)}\n\nPlease help me draft a thoughtful response addressing the feedback.`);
44
+ }
45
+ catch (e) {
46
+ console.error('[MCP] Prompt error (respond-to-pr):', e);
47
+ return userMessage(`Failed to fetch PR comments: ${errorMessage(e)}`);
48
+ }
49
+ });
50
+ // 3. find-issues — optional maxResults, searches for contributable issues
51
+ server.registerPrompt('find-issues', {
52
+ title: 'Find Issues to Work On',
53
+ description: 'Search for good issues to contribute to, ranked by viability',
54
+ argsSchema: {
55
+ maxResults: z.coerce.number().optional().describe('Max issues to return (default: 5)'),
56
+ },
57
+ }, async ({ maxResults }) => {
58
+ try {
59
+ const data = await runSearch({ maxResults: maxResults ?? 5 });
60
+ const candidateList = data.candidates
61
+ .map((c, i) => `${i + 1}. [${c.recommendation.toUpperCase()}] ${c.issue.repo}#${c.issue.number}: ${c.issue.title}\n URL: ${c.issue.url}\n Score: ${c.viabilityScore}/100\n Approve: ${c.reasonsToApprove.join(', ') || 'None'}\n Skip: ${c.reasonsToSkip.join(', ') || 'None'}`)
62
+ .join('\n\n');
63
+ const warning = data.rateLimitWarning ? `\n\nNote: ${data.rateLimitWarning}` : '';
64
+ return userMessage(`Here are potential issues I could work on. Help me pick the best one:\n\n${candidateList}${warning}`);
65
+ }
66
+ catch (e) {
67
+ console.error('[MCP] Prompt error (find-issues):', e);
68
+ return userMessage(`Failed to search for issues: ${errorMessage(e)}`);
69
+ }
70
+ });
71
+ }
72
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,qEAAqE;AACrE,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE;aACzC;SACF;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,kEAAkE;IAClE,MAAM,CAAC,cAAc,CACnB,QAAQ,EACR;QACE,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,0EAA0E;KACxF,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,QAAQ,EAAE,CAAC;YAC9B,OAAO,WAAW,CAChB,iFAAiF,IAAI,CAAC,OAAO,2BAA2B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAChO,CAA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,CAAC,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ /**
3
+ * Registers all OSS Autopilot MCP resources on the given server.
4
+ *
5
+ * Static resources:
6
+ * - oss://status — Current PR tracking status (offline mode)
7
+ * - oss://config — Current configuration
8
+ * - oss://prs — Active (open) PRs from last daily digest
9
+ * - oss://prs/shelved — Shelved PRs from last daily digest
10
+ *
11
+ * Dynamic resource templates:
12
+ * - oss://pr/{owner}/{repo}/{number} — Detail for a specific PR
13
+ */
14
+ export declare function registerResources(server: McpServer): void;
15
+ //# sourceMappingURL=resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwBzE;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqGzD"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * MCP resource registrations for OSS Autopilot.
3
+ *
4
+ * Registers static resources and dynamic resource templates that expose
5
+ * oss-autopilot state data (status, config, PRs) via the MCP resource protocol.
6
+ */
7
+ import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ import { runStatus, runConfig } from '@oss-autopilot/core/commands';
9
+ import { getStateManager } from '@oss-autopilot/core';
10
+ import { errorMessage } from './tools.js';
11
+ /** Build a standard MCP resource response with a single JSON content entry. */
12
+ function resourceContent(uri, data) {
13
+ return {
14
+ contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(data, null, 2) }],
15
+ };
16
+ }
17
+ /** Wrap an async data-fetching function with error handling for use as an MCP resource callback. */
18
+ function wrapResource(fn) {
19
+ return async (uri) => {
20
+ try {
21
+ return resourceContent(uri, await fn());
22
+ }
23
+ catch (e) {
24
+ console.error('[MCP] Resource error:', e);
25
+ return resourceContent(uri, { error: errorMessage(e) });
26
+ }
27
+ };
28
+ }
29
+ /**
30
+ * Registers all OSS Autopilot MCP resources on the given server.
31
+ *
32
+ * Static resources:
33
+ * - oss://status — Current PR tracking status (offline mode)
34
+ * - oss://config — Current configuration
35
+ * - oss://prs — Active (open) PRs from last daily digest
36
+ * - oss://prs/shelved — Shelved PRs from last daily digest
37
+ *
38
+ * Dynamic resource templates:
39
+ * - oss://pr/{owner}/{repo}/{number} — Detail for a specific PR
40
+ */
41
+ export function registerResources(server) {
42
+ // 1. status — Current PR tracking status (offline, no GitHub fetch)
43
+ server.registerResource('status', 'oss://status', {
44
+ title: 'PR Tracking Status',
45
+ description: 'Current PR tracking status including open PRs, snoozed PRs, shelved PRs, and dismissed issues. Uses cached local state only (no GitHub fetch).',
46
+ mimeType: 'application/json',
47
+ }, wrapResource(() => runStatus({ offline: true })));
48
+ // 2. config — Current configuration
49
+ server.registerResource('config', 'oss://config', {
50
+ title: 'Configuration',
51
+ description: 'Current OSS Autopilot configuration including languages, interests, contribution goals, and preferences.',
52
+ mimeType: 'application/json',
53
+ }, wrapResource(() => runConfig({})));
54
+ // 3. active-prs — Open PRs from the last daily digest
55
+ server.registerResource('active-prs', 'oss://prs', {
56
+ title: 'Active PRs',
57
+ description: 'All open pull requests from the last daily digest, including CI status, review state, and priority information.',
58
+ mimeType: 'application/json',
59
+ }, wrapResource(async () => getStateManager().getState().lastDigest?.openPRs ?? []));
60
+ // 4. shelved-prs — Shelved PRs from the last daily digest
61
+ server.registerResource('shelved-prs', 'oss://prs/shelved', {
62
+ title: 'Shelved PRs',
63
+ description: 'Pull requests that have been manually shelved, temporarily hidden from daily checks and status reports.',
64
+ mimeType: 'application/json',
65
+ }, wrapResource(async () => getStateManager().getState().lastDigest?.shelvedPRs ?? []));
66
+ // 5. pr-detail — Dynamic template for a specific PR by owner/repo/number
67
+ server.registerResource('pr-detail', new ResourceTemplate('oss://pr/{owner}/{repo}/{number}', {
68
+ list: async () => {
69
+ try {
70
+ const openPRs = getStateManager().getState().lastDigest?.openPRs ?? [];
71
+ return {
72
+ resources: openPRs.map((pr) => {
73
+ const [owner, repo] = pr.repo.split('/');
74
+ return {
75
+ uri: `oss://pr/${owner}/${repo}/${pr.number}`,
76
+ name: `${pr.repo}#${pr.number}`,
77
+ description: pr.title,
78
+ mimeType: 'application/json',
79
+ };
80
+ }),
81
+ };
82
+ }
83
+ catch (e) {
84
+ console.error('[MCP] Failed to list PR resources:', e);
85
+ return { resources: [] };
86
+ }
87
+ },
88
+ }), {
89
+ title: 'PR Detail',
90
+ description: 'Detailed information for a specific pull request, including CI status, review decisions, merge conflicts, and maintainer comments.',
91
+ mimeType: 'application/json',
92
+ }, async (uri, { owner, repo, number }) => {
93
+ try {
94
+ const openPRs = getStateManager().getState().lastDigest?.openPRs ?? [];
95
+ const prNumber = parseInt(String(number), 10);
96
+ if (Number.isNaN(prNumber)) {
97
+ return resourceContent(uri, { error: `Invalid PR number: ${String(number)}` });
98
+ }
99
+ const fullRepo = `${String(owner)}/${String(repo)}`;
100
+ const pr = openPRs.find((p) => p.repo === fullRepo && p.number === prNumber);
101
+ if (!pr) {
102
+ return resourceContent(uri, { error: `PR ${fullRepo}#${prNumber} not found in last daily digest` });
103
+ }
104
+ return resourceContent(uri, pr);
105
+ }
106
+ catch (e) {
107
+ return resourceContent(uri, { error: errorMessage(e) });
108
+ }
109
+ });
110
+ }
111
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EA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O,eAAe,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,eAAe,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ /**
3
+ * Create a fully configured MCP server with all tools, resources, and prompts registered.
4
+ */
5
+ export declare function createServer(): McpServer;
6
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBpE;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAWxC"}
package/dist/server.js ADDED
@@ -0,0 +1,40 @@
1
+ /**
2
+ * MCP server factory for OSS Autopilot.
3
+ *
4
+ * Creates and configures a McpServer instance with all tools, resources,
5
+ * and prompts registered.
6
+ */
7
+ import { readFileSync } from 'node:fs';
8
+ import { dirname, join } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
11
+ import { registerTools } from './tools.js';
12
+ import { registerResources } from './resources.js';
13
+ import { registerPrompts } from './prompts.js';
14
+ const version = (() => {
15
+ try {
16
+ // In CJS bundle: __dirname is defined by esbuild
17
+ // In ESM (dev via tsx): use import.meta.url
18
+ const dir = typeof __dirname !== 'undefined' ? __dirname : dirname(fileURLToPath(import.meta.url));
19
+ const pkg = JSON.parse(readFileSync(join(dir, '..', 'package.json'), 'utf-8'));
20
+ return pkg.version;
21
+ }
22
+ catch (e) {
23
+ console.error('[MCP] Failed to read package version:', e);
24
+ return '0.0.0';
25
+ }
26
+ })();
27
+ /**
28
+ * Create a fully configured MCP server with all tools, resources, and prompts registered.
29
+ */
30
+ export function createServer() {
31
+ const server = new McpServer({
32
+ name: 'oss-autopilot',
33
+ version,
34
+ });
35
+ registerTools(server);
36
+ registerResources(server);
37
+ registerPrompts(server);
38
+ return server;
39
+ }
40
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,OAAO,GAAW,CAAC,GAAG,EAAE;IAC5B,IAAI,CAAC;QACH,iDAAiD;QACjD,4CAA4C;QAC5C,MAAM,GAAG,GAAG,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnG,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAC/E,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,CAAC,CAAC,CAAC;QAC1D,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AAEL;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,eAAe;QACrB,OAAO;KACR,CAAC,CAAC;IAEH,aAAa,CAAC,MAAM,CAAC,CAAC;IACtB,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ /** Extract a human-readable message from an unknown error. */
3
+ export declare function errorMessage(e: unknown): string;
4
+ /**
5
+ * Registers all 21 OSS Autopilot CLI commands as MCP tools on the given server.
6
+ */
7
+ export declare function registerTools(server: McpServer): void;
8
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAyBzE,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE/C;AA6BD;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmSrD"}
package/dist/tools.js ADDED
@@ -0,0 +1,221 @@
1
+ /**
2
+ * MCP tool registrations for all OSS Autopilot CLI commands.
3
+ *
4
+ * Each CLI command is registered as an MCP tool with:
5
+ * - Zod input schema matching the command's options
6
+ * - Annotations indicating read-only vs mutating behavior
7
+ * - wrapTool() helper for uniform ok/err handling
8
+ */
9
+ import { z } from 'zod';
10
+ import { runDaily, runStatus, runSearch, runVet, runTrack, runUntrack, runRead, runComments, runPost, runClaim, runConfig, runInit, runSetup, runCheckSetup, runStartup, runShelve, runUnshelve, runDismiss, runUndismiss, runSnooze, runUnsnooze, } from '@oss-autopilot/core/commands';
11
+ /** Extract a human-readable message from an unknown error. */
12
+ export function errorMessage(e) {
13
+ return e instanceof Error ? e.message : String(e);
14
+ }
15
+ /** Standard MCP text content result. */
16
+ function ok(data) {
17
+ return {
18
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) ?? 'null' }],
19
+ };
20
+ }
21
+ /** Standard MCP error result. */
22
+ function err(e) {
23
+ return {
24
+ content: [{ type: 'text', text: errorMessage(e) }],
25
+ isError: true,
26
+ };
27
+ }
28
+ /** Wrap an async command function with ok/err handling for use as an MCP tool callback. */
29
+ function wrapTool(fn) {
30
+ return async (args) => {
31
+ try {
32
+ return ok(await fn(args));
33
+ }
34
+ catch (e) {
35
+ console.error('[MCP] Tool error:', e);
36
+ return err(e);
37
+ }
38
+ };
39
+ }
40
+ /**
41
+ * Registers all 21 OSS Autopilot CLI commands as MCP tools on the given server.
42
+ */
43
+ export function registerTools(server) {
44
+ // 1. daily — Run daily PR check
45
+ server.registerTool('daily', {
46
+ description: 'Run daily PR monitoring check. Fetches all open PRs, enriches with CI status, reviews, and conflicts, then returns a prioritized summary.',
47
+ inputSchema: {},
48
+ annotations: { readOnlyHint: false, destructiveHint: false },
49
+ }, wrapTool(runDaily));
50
+ // 2. status — Show tracking status
51
+ server.registerTool('status', {
52
+ description: 'Show current PR tracking status including open PRs, snoozed PRs, shelved PRs, and dismissed issues.',
53
+ inputSchema: {
54
+ offline: z
55
+ .boolean()
56
+ .optional()
57
+ .describe('If true, show only locally cached state without fetching from GitHub'),
58
+ },
59
+ annotations: { readOnlyHint: true },
60
+ }, wrapTool(runStatus));
61
+ // 3. search — Search for contributable issues
62
+ server.registerTool('search', {
63
+ description: 'Search GitHub for beginner-friendly open-source issues to contribute to. Returns issues matching configured languages and interests.',
64
+ inputSchema: {
65
+ maxResults: z.number().optional().describe('Maximum number of issues to return (default: 5)'),
66
+ },
67
+ annotations: { readOnlyHint: true },
68
+ }, wrapTool((args) => runSearch({ maxResults: args.maxResults ?? 5 })));
69
+ // 4. vet — Vet an issue for contribution suitability
70
+ server.registerTool('vet', {
71
+ description: 'Analyze a GitHub issue to determine if it is a good candidate for contribution. Checks for clarity, scope, existing assignees, and staleness.',
72
+ inputSchema: {
73
+ issueUrl: z.string().describe('Full GitHub issue URL to vet (e.g. https://github.com/owner/repo/issues/123)'),
74
+ },
75
+ annotations: { readOnlyHint: true },
76
+ }, wrapTool(runVet));
77
+ // 5. track — Track a PR
78
+ server.registerTool('track', {
79
+ description: 'Start tracking a pull request. Adds the PR to your monitored list so it appears in daily checks and status reports.',
80
+ inputSchema: {
81
+ prUrl: z.string().describe('Full GitHub PR URL to track (e.g. https://github.com/owner/repo/pull/123)'),
82
+ },
83
+ annotations: { readOnlyHint: false, destructiveHint: false },
84
+ }, wrapTool(runTrack));
85
+ // 6. untrack — Stop tracking a PR
86
+ server.registerTool('untrack', {
87
+ description: 'Stop tracking a pull request. Removes the PR from your monitored list.',
88
+ inputSchema: {
89
+ prUrl: z.string().describe('Full GitHub PR URL to untrack (e.g. https://github.com/owner/repo/pull/123)'),
90
+ },
91
+ annotations: { readOnlyHint: false, destructiveHint: true },
92
+ }, wrapTool(runUntrack));
93
+ // 7. read — Mark notifications as read
94
+ server.registerTool('read', {
95
+ description: 'Mark PR notifications as read. Requires either prUrl or all to be specified.',
96
+ inputSchema: {
97
+ prUrl: z.string().optional().describe('Full GitHub PR URL to mark as read. Omit to use --all instead.'),
98
+ all: z.boolean().optional().describe('If true, mark all PRs as read'),
99
+ },
100
+ annotations: { readOnlyHint: false, destructiveHint: false },
101
+ }, wrapTool(runRead));
102
+ // 8. comments — Show PR comments
103
+ server.registerTool('comments', {
104
+ description: 'Fetch and display comments on a pull request, including review comments and issue comments.',
105
+ inputSchema: {
106
+ prUrl: z.string().describe('Full GitHub PR URL to fetch comments for'),
107
+ showBots: z.boolean().optional().describe('If true, include bot comments in the output'),
108
+ },
109
+ annotations: { readOnlyHint: true },
110
+ }, wrapTool(runComments));
111
+ // 9. post — Post a comment
112
+ server.registerTool('post', {
113
+ description: 'Post a comment on a GitHub issue or pull request.',
114
+ inputSchema: {
115
+ url: z.string().describe('Full GitHub issue or PR URL to comment on'),
116
+ message: z.string().describe('The comment text to post'),
117
+ },
118
+ annotations: { readOnlyHint: false, destructiveHint: false },
119
+ }, wrapTool(runPost));
120
+ // 10. claim — Claim an issue
121
+ server.registerTool('claim', {
122
+ description: 'Claim a GitHub issue by posting a comment expressing intent to work on it.',
123
+ inputSchema: {
124
+ issueUrl: z.string().describe('Full GitHub issue URL to claim'),
125
+ message: z.string().optional().describe('Custom claim message. If omitted, a default message is used.'),
126
+ },
127
+ annotations: { readOnlyHint: false, destructiveHint: false },
128
+ }, wrapTool(runClaim));
129
+ // 11. config — Get or set configuration
130
+ server.registerTool('config', {
131
+ description: 'Get or set OSS Autopilot configuration values. With no args, shows all config. With key and value, sets the value.',
132
+ inputSchema: {
133
+ key: z.string().optional().describe('Configuration key to get or set (e.g. "languages", "username")'),
134
+ value: z.string().optional().describe('Value to set for the given key. Omit to read the current value.'),
135
+ },
136
+ annotations: { readOnlyHint: false, idempotentHint: true },
137
+ }, wrapTool(runConfig));
138
+ // 12. init — Initialize with GitHub username
139
+ server.registerTool('init', {
140
+ description: 'Initialize OSS Autopilot with a GitHub username. Creates the state file and sets up initial configuration.',
141
+ inputSchema: {
142
+ username: z.string().describe('Your GitHub username'),
143
+ },
144
+ annotations: { readOnlyHint: false, destructiveHint: false },
145
+ }, wrapTool(runInit));
146
+ // 13. setup — Interactive setup
147
+ server.registerTool('setup', {
148
+ description: 'Run OSS Autopilot setup to configure preferences like languages, interests, and contribution goals.',
149
+ inputSchema: {
150
+ reset: z.boolean().optional().describe('If true, reset all preferences to defaults before running setup'),
151
+ set: z
152
+ .array(z.string())
153
+ .optional()
154
+ .describe('Set preferences non-interactively as key=value pairs (e.g. ["languages=typescript,rust"])'),
155
+ },
156
+ annotations: { readOnlyHint: false, destructiveHint: false },
157
+ }, wrapTool(runSetup));
158
+ // 14. check-setup — Check if setup is complete
159
+ server.registerTool('check-setup', {
160
+ description: 'Check whether OSS Autopilot is properly set up and configured. Returns setup status and any missing configuration.',
161
+ inputSchema: {},
162
+ annotations: { readOnlyHint: true },
163
+ }, wrapTool(runCheckSetup));
164
+ // 15. startup — Run startup checks
165
+ server.registerTool('startup', {
166
+ description: 'Run startup checks including GitHub auth verification, state file validation, and configuration status.',
167
+ inputSchema: {},
168
+ annotations: { readOnlyHint: false, destructiveHint: false },
169
+ }, wrapTool(runStartup));
170
+ // 16. shelve — Shelve a PR
171
+ server.registerTool('shelve', {
172
+ description: 'Shelve a PR to temporarily hide it from daily checks and status reports without untracking it.',
173
+ inputSchema: {
174
+ prUrl: z.string().describe('Full GitHub PR URL to shelve'),
175
+ },
176
+ annotations: { readOnlyHint: false, destructiveHint: false },
177
+ }, wrapTool(runShelve));
178
+ // 17. unshelve — Unshelve a PR
179
+ server.registerTool('unshelve', {
180
+ description: 'Unshelve a previously shelved PR, returning it to active monitoring.',
181
+ inputSchema: {
182
+ prUrl: z.string().describe('Full GitHub PR URL to unshelve'),
183
+ },
184
+ annotations: { readOnlyHint: false, destructiveHint: false },
185
+ }, wrapTool(runUnshelve));
186
+ // 18. dismiss — Dismiss an issue
187
+ server.registerTool('dismiss', {
188
+ description: 'Dismiss a GitHub issue so it no longer appears in search results.',
189
+ inputSchema: {
190
+ issueUrl: z.string().describe('Full GitHub issue URL to dismiss'),
191
+ },
192
+ annotations: { readOnlyHint: false, destructiveHint: false },
193
+ }, wrapTool(runDismiss));
194
+ // 19. undismiss — Undismiss an issue
195
+ server.registerTool('undismiss', {
196
+ description: 'Undismiss a previously dismissed issue, allowing it to appear in search results again.',
197
+ inputSchema: {
198
+ issueUrl: z.string().describe('Full GitHub issue URL to undismiss'),
199
+ },
200
+ annotations: { readOnlyHint: false, destructiveHint: false },
201
+ }, wrapTool(runUndismiss));
202
+ // 20. snooze — Snooze a PR
203
+ server.registerTool('snooze', {
204
+ description: 'Snooze a PR to temporarily hide it from daily checks for a specified number of days.',
205
+ inputSchema: {
206
+ prUrl: z.string().describe('Full GitHub PR URL to snooze'),
207
+ reason: z.string().describe('Reason for snoozing (e.g. "waiting for CI fix", "reviewer on vacation")'),
208
+ days: z.number().optional().describe('Number of days to snooze. Defaults to 7 if omitted.'),
209
+ },
210
+ annotations: { readOnlyHint: false, destructiveHint: false },
211
+ }, wrapTool(runSnooze));
212
+ // 21. unsnooze — Unsnooze a PR
213
+ server.registerTool('unsnooze', {
214
+ description: 'Unsnooze a previously snoozed PR, returning it to active monitoring immediately.',
215
+ inputSchema: {
216
+ prUrl: z.string().describe('Full GitHub PR URL to unsnooze'),
217
+ },
218
+ annotations: { readOnlyHint: false, destructiveHint: false },
219
+ }, wrapTool(runUnsnooze));
220
+ }
221
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,UAAU,EACV,OAAO,EACP,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,aAAa,EACb,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAEtC,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,CAAU;IACrC,OAAO,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,wCAAwC;AACxC,SAAS,EAAE,CAAC,IAAa;IACvB,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI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F,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;SAC7D;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;KAC7D,EACD,QAAQ,CAAC,WAAW,CAAC,CACtB,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@oss-autopilot/mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for OSS Autopilot — exposes PR tracking, issue discovery, and contribution management as MCP tools",
5
+ "type": "module",
6
+ "bin": {
7
+ "oss-autopilot-mcp": "./dist/mcp-server.bundle.cjs"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist/"
17
+ ],
18
+ "dependencies": {
19
+ "@modelcontextprotocol/sdk": "^1.27.1",
20
+ "zod": "^3.25.0",
21
+ "@oss-autopilot/core": "0.42.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^25.3.3",
25
+ "esbuild": "^0.27.3",
26
+ "tsx": "^4.21.0",
27
+ "typescript": "^5.9.3",
28
+ "vitest": "^4.0.16"
29
+ },
30
+ "engines": {
31
+ "node": ">=20"
32
+ },
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/costajohnt/oss-autopilot.git",
37
+ "directory": "packages/mcp-server"
38
+ },
39
+ "scripts": {
40
+ "build": "tsc",
41
+ "bundle": "esbuild src/index.ts --bundle --platform=node --target=node20 --format=cjs --outfile=dist/mcp-server.bundle.cjs --banner:js='#!/usr/bin/env node'",
42
+ "test": "vitest run",
43
+ "test:watch": "vitest",
44
+ "typecheck": "tsc --noEmit"
45
+ }
46
+ }