@pipeworx/mcp-ashby 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pipeworx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # mcp-ashby
2
+
3
+ Ashby MCP Pack — wraps the Ashby ATS API
4
+
5
+ Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+
12
+ ## Quick Start
13
+
14
+ Add to your MCP client config:
15
+
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "ashby": {
20
+ "url": "https://gateway.pipeworx.io/ashby/mcp"
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Or use the CLI:
27
+
28
+ ```bash
29
+ npx pipeworx use ashby
30
+ ```
31
+
32
+ ## License
33
+
34
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-ashby",
3
+ "version": "0.1.0",
4
+ "description": "Ashby MCP Pack — wraps the Ashby ATS API",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "ashby"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-ashby"
13
+ },
14
+ "scripts": {
15
+ "typecheck": "tsc --noEmit"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.7.0"
19
+ }
20
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/ashby",
4
+ "title": "ashuy",
5
+ "description": "Ashby MCP Pack — wraps the Ashby ATS API",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/ashby",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-ashby",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/ashby/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,160 @@
1
+ interface McpToolDefinition {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: 'object';
6
+ properties: Record<string, unknown>;
7
+ required?: string[];
8
+ };
9
+ }
10
+
11
+ interface McpToolExport {
12
+ tools: McpToolDefinition[];
13
+ callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
14
+ }
15
+
16
+ /**
17
+ * Ashby MCP Pack — wraps the Ashby ATS API
18
+ *
19
+ * BYO key: _apiKey (Ashby API key).
20
+ * Auth: Basic auth with apiKey as username, empty password.
21
+ * All endpoints are POST with JSON body.
22
+ * Tools: list/get candidates, list/get jobs, list applications.
23
+ */
24
+
25
+
26
+ const API = 'https://api.ashbyhq.com';
27
+
28
+ function authHeaders(apiKey: string): Record<string, string> {
29
+ const encoded = btoa(`${apiKey}:`);
30
+ return {
31
+ Authorization: `Basic ${encoded}`,
32
+ 'Content-Type': 'application/json',
33
+ };
34
+ }
35
+
36
+ async function ashbyPost(apiKey: string, path: string, body: Record<string, unknown>): Promise<unknown> {
37
+ const res = await fetch(`${API}${path}`, {
38
+ method: 'POST',
39
+ headers: authHeaders(apiKey),
40
+ body: JSON.stringify(body),
41
+ });
42
+ if (!res.ok) {
43
+ const text = await res.text();
44
+ throw new Error(`Ashby API error (${res.status}): ${text}`);
45
+ }
46
+ return res.json();
47
+ }
48
+
49
+ // -- Tool definitions --------------------------------------------------------
50
+
51
+ const tools: McpToolExport['tools'] = [
52
+ {
53
+ name: 'ashby_list_candidates',
54
+ description:
55
+ 'List candidates from Ashby. Returns candidate names, emails, and metadata.',
56
+ inputSchema: {
57
+ type: 'object' as const,
58
+ properties: {
59
+ _apiKey: { type: 'string', description: 'Ashby API key' },
60
+ cursor: { type: 'string', description: 'Pagination cursor from a previous response' },
61
+ per_page: { type: 'number', description: 'Number of candidates per page (default 50)' },
62
+ },
63
+ required: ['_apiKey'],
64
+ },
65
+ },
66
+ {
67
+ name: 'ashby_get_candidate',
68
+ description:
69
+ 'Get details for a specific candidate by their ID. Returns full candidate profile.',
70
+ inputSchema: {
71
+ type: 'object' as const,
72
+ properties: {
73
+ _apiKey: { type: 'string', description: 'Ashby API key' },
74
+ candidateId: { type: 'string', description: 'Ashby candidate ID' },
75
+ },
76
+ required: ['_apiKey', 'candidateId'],
77
+ },
78
+ },
79
+ {
80
+ name: 'ashby_list_jobs',
81
+ description:
82
+ 'List jobs from Ashby. Optionally filter by status (open, closed, draft, archived).',
83
+ inputSchema: {
84
+ type: 'object' as const,
85
+ properties: {
86
+ _apiKey: { type: 'string', description: 'Ashby API key' },
87
+ status: {
88
+ type: 'string',
89
+ description: 'Filter by job status: Open, Closed, Draft, Archived',
90
+ },
91
+ },
92
+ required: ['_apiKey'],
93
+ },
94
+ },
95
+ {
96
+ name: 'ashby_get_job',
97
+ description:
98
+ 'Get details for a specific job by its ID. Returns full job posting information.',
99
+ inputSchema: {
100
+ type: 'object' as const,
101
+ properties: {
102
+ _apiKey: { type: 'string', description: 'Ashby API key' },
103
+ jobId: { type: 'string', description: 'Ashby job ID' },
104
+ },
105
+ required: ['_apiKey', 'jobId'],
106
+ },
107
+ },
108
+ {
109
+ name: 'ashby_list_applications',
110
+ description:
111
+ 'List job applications from Ashby. Returns application details including candidate and job info.',
112
+ inputSchema: {
113
+ type: 'object' as const,
114
+ properties: {
115
+ _apiKey: { type: 'string', description: 'Ashby API key' },
116
+ cursor: { type: 'string', description: 'Pagination cursor from a previous response' },
117
+ per_page: { type: 'number', description: 'Number of applications per page (default 50)' },
118
+ },
119
+ required: ['_apiKey'],
120
+ },
121
+ },
122
+ ];
123
+
124
+ // -- callTool dispatcher -----------------------------------------------------
125
+
126
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
127
+ const apiKey = args._apiKey as string | undefined;
128
+ delete args._context;
129
+ delete args._apiKey;
130
+
131
+ if (!apiKey) throw new Error('_apiKey is required for Ashby API access');
132
+
133
+ switch (name) {
134
+ case 'ashby_list_candidates': {
135
+ const body: Record<string, unknown> = {};
136
+ if (args.cursor) body.cursor = args.cursor;
137
+ if (args.per_page) body.perPage = args.per_page;
138
+ return ashbyPost(apiKey, '/candidate.list', body);
139
+ }
140
+ case 'ashby_get_candidate':
141
+ return ashbyPost(apiKey, '/candidate.info', { candidateId: args.candidateId as string });
142
+ case 'ashby_list_jobs': {
143
+ const body: Record<string, unknown> = {};
144
+ if (args.status) body.status = args.status;
145
+ return ashbyPost(apiKey, '/job.list', body);
146
+ }
147
+ case 'ashby_get_job':
148
+ return ashbyPost(apiKey, '/job.info', { jobId: args.jobId as string });
149
+ case 'ashby_list_applications': {
150
+ const body: Record<string, unknown> = {};
151
+ if (args.cursor) body.cursor = args.cursor;
152
+ if (args.per_page) body.perPage = args.per_page;
153
+ return ashbyPost(apiKey, '/application.list', body);
154
+ }
155
+ default:
156
+ throw new Error(`Unknown tool: ${name}`);
157
+ }
158
+ }
159
+
160
+ export default { tools, callTool, meter: { credits: 10 } } satisfies McpToolExport;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "outDir": "dist",
10
+ "rootDir": "src",
11
+ "declaration": true
12
+ },
13
+ "include": ["src"]
14
+ }