@coldbirds/mcp-server 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.
- package/dist/client.js +1 -0
- package/dist/index.js +3 -0
- package/dist/json-schema-to-zod.js +1 -0
- package/dist/manifest.js +2 -0
- package/dist/mcp.fallback.json +3018 -0
- package/dist/tools.js +1 -0
- package/package.json +64 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__internals=void 0,exports.registerTools=registerTools;const types_js_1=require("@modelcontextprotocol/sdk/types.js"),json_schema_to_zod_1=require("./json-schema-to-zod"),PLACEHOLDER_RE=/\{(\w+)\}/g;function pathParams(t){const n=[];for(const o of t.matchAll(PLACEHOLDER_RE)){const e=o[1];e&&n.push(e)}return n}function stringifyPathValue(t,n){if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);throw new Error(`Path parameter '${t}' must be a string, number, or boolean (got ${typeof n})`)}function interpolate(t,n){return t.replace(PLACEHOLDER_RE,(o,e)=>{const r=n[e];if(r==null)throw new Error(`Missing required path parameter '${e}'`);return encodeURIComponent(stringifyPathValue(e,r))})}function remainingArgs(t,n){const o={};for(const[e,r]of Object.entries(t))n.includes(e)||(o[e]=r);return o}function asQuery(t){return t}async function dispatch(t,n,o){const{method:e,path:r}=n._http,i=pathParams(r),s=interpolate(r,o),c=remainingArgs(o,i),u=Object.keys(c).length>0;switch(e){case"GET":return t.get(s,u?c:void 0);case"POST":return t.post(s,u?c:void 0);case"PATCH":return t.patch(s,u?c:void 0);case"DELETE":return await t.delete(s)??{ok:!0}}}function ok(t){return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}function fail(t){return{content:[{type:"text",text:t}],isError:!0}}function buildHandler(t,n){return async o=>{try{const e=await dispatch(t,n,o);return ok(e)}catch(e){const r=e instanceof Error?e.message:String(e);return fail(`Tool '${n.name}' failed: ${r}`)}}}function buildInputSchema(t){const n=(0,json_schema_to_zod_1.jsonSchemaToZod)(t.inputSchema);if(n._def?.typeName!=="ZodObject")throw new Error(`Tool '${t.name}' inputSchema must be a JSON-Schema object at the root`);return n}function registerTools(t,n,o){for(const e of o.tools){const r={description:e.description,inputSchema:buildInputSchema(e)};e.title&&(r.title=e.title),t.registerTool(e.name,r,buildHandler(n,e))}t.server.setRequestHandler(types_js_1.ListToolsRequestSchema,()=>({tools:o.tools.map(e=>{const{_http:r,...i}=e;return i})}))}exports.__internals={dispatch,pathParams,interpolate,remainingArgs};
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coldbirds/mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for ColdBirds Sequence — control campaigns, contacts, and mailboxes from AI assistants like Claude Desktop, Cursor, and Windsurf.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"coldbirds",
|
|
7
|
+
"mcp",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"cold-email",
|
|
10
|
+
"ai",
|
|
11
|
+
"claude",
|
|
12
|
+
"cursor"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/elitale/coldbirds",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Elitale Technologies",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"bin": {
|
|
23
|
+
"coldbirds-mcp": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"sync-manifest": "node -e \"require('fs').copyFileSync(require('path').resolve('../../public/mcp.json'), require('path').resolve('src/mcp.fallback.json'))\"",
|
|
31
|
+
"prebuild": "rm -rf dist && npm run sync-manifest",
|
|
32
|
+
"build": "tsc -p tsconfig.build.json && node -e \"require('fs').copyFileSync(require('path').resolve('src/mcp.fallback.json'), require('path').resolve('dist/mcp.fallback.json'))\"",
|
|
33
|
+
"postbuild": "npm run minify",
|
|
34
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
35
|
+
"minify": "esbuild dist/*.js --minify --outdir=dist --allow-overwrite",
|
|
36
|
+
"start": "node dist/index.js",
|
|
37
|
+
"lint": "eslint src",
|
|
38
|
+
"test": "jest --config jest.config.cjs",
|
|
39
|
+
"test:coverage": "jest --config jest.config.cjs --coverage",
|
|
40
|
+
"prepublishOnly": "npm run build && npm run lint && npm test"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
44
|
+
"axios": "^1.17.0",
|
|
45
|
+
"zod": "^3.22.4"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@eslint/js": "^9.0.0",
|
|
49
|
+
"@jest/globals": "^29.0.0",
|
|
50
|
+
"@types/jest": "^29.0.0",
|
|
51
|
+
"@types/node": "^22.0.0",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
53
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
54
|
+
"esbuild": "^0.28.1",
|
|
55
|
+
"eslint": "^9.0.0",
|
|
56
|
+
"jest": "^29.0.0",
|
|
57
|
+
"ts-jest": "^29.0.0",
|
|
58
|
+
"typescript": "^5.9.0",
|
|
59
|
+
"typescript-eslint": "^8.0.0"
|
|
60
|
+
},
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
}
|
|
64
|
+
}
|