@freelancercom/phabricator-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,19 @@
1
+ import { z } from 'zod';
2
+ export function registerTransactionTools(server, client) {
3
+ server.tool('phabricator_transaction_search', 'Search transactions (comments, status changes, etc.) on any Phabricator object (e.g., "D123", "T456")', {
4
+ objectIdentifier: z.string().describe('Object ID (e.g., "D123", "T456") or PHID'),
5
+ constraints: z.object({
6
+ phids: z.array(z.string()).optional().describe('Transaction PHIDs'),
7
+ authorPHIDs: z.array(z.string()).optional().describe('Author PHIDs'),
8
+ }).optional().describe('Search constraints'),
9
+ limit: z.number().max(100).optional().describe('Maximum results (max 100)'),
10
+ after: z.string().optional().describe('Pagination cursor'),
11
+ }, async (params) => {
12
+ const { objectIdentifier, ...searchParams } = params;
13
+ const result = await client.call('transaction.search', {
14
+ objectIdentifier,
15
+ ...searchParams,
16
+ });
17
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
18
+ });
19
+ }
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { ConduitClient } from '../client/conduit.js';
3
+ export declare function registerUserTools(server: McpServer, client: ConduitClient): void;
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ export function registerUserTools(server, client) {
3
+ // Get current user
4
+ server.tool('phabricator_user_whoami', 'Get information about the current authenticated user', {}, async () => {
5
+ const result = await client.call('user.whoami');
6
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
7
+ });
8
+ // Search users
9
+ server.tool('phabricator_user_search', 'Search Phabricator users', {
10
+ queryKey: z.string().optional().describe('Built-in query: "all", "active", "approval"'),
11
+ constraints: z.object({
12
+ ids: z.array(z.number()).optional().describe('User IDs'),
13
+ phids: z.array(z.string()).optional().describe('User PHIDs'),
14
+ usernames: z.array(z.string()).optional().describe('Usernames'),
15
+ nameLike: z.string().optional().describe('Name prefix search'),
16
+ isAdmin: z.boolean().optional().describe('Filter by admin status'),
17
+ isDisabled: z.boolean().optional().describe('Filter by disabled status'),
18
+ isBot: z.boolean().optional().describe('Filter by bot status'),
19
+ isMailingList: z.boolean().optional().describe('Filter by mailing list status'),
20
+ query: z.string().optional().describe('Full-text search query'),
21
+ }).optional().describe('Search constraints'),
22
+ attachments: z.object({
23
+ availability: z.boolean().optional().describe('Include availability info'),
24
+ }).optional().describe('Data attachments'),
25
+ order: z.string().optional().describe('Result order'),
26
+ limit: z.number().max(100).optional().describe('Maximum results'),
27
+ after: z.string().optional().describe('Pagination cursor'),
28
+ }, async (params) => {
29
+ const result = await client.call('user.search', params);
30
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
31
+ });
32
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@freelancercom/phabricator-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for Phabricator Conduit API - manage tasks, code reviews, repositories, and more",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "phabricator-mcp": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "prepare": "npm run build",
16
+ "start": "node dist/index.js",
17
+ "dev": "tsx --watch src/index.ts",
18
+ "typecheck": "tsc --noEmit",
19
+ "test": "node --test --import tsx 'src/**/*.test.ts'"
20
+ },
21
+ "keywords": [
22
+ "mcp",
23
+ "model-context-protocol",
24
+ "phabricator",
25
+ "conduit",
26
+ "ai",
27
+ "llm"
28
+ ],
29
+ "author": "Laurent Goudet",
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/freelancer/phabricator-mcp.git"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/freelancer/phabricator-mcp/issues"
37
+ },
38
+ "homepage": "https://github.com/freelancer/phabricator-mcp#readme",
39
+ "dependencies": {
40
+ "@modelcontextprotocol/sdk": "^1.0.0",
41
+ "zod": "^3.23.0"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^20.0.0",
45
+ "tsx": "^4.0.0",
46
+ "typescript": "^5.0.0"
47
+ },
48
+ "engines": {
49
+ "node": ">=18.0.0"
50
+ }
51
+ }