@omnifox/mcp-server 0.2.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/.env.example +27 -0
- package/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/omnifox/client.d.ts +74 -0
- package/dist/omnifox/client.d.ts.map +1 -0
- package/dist/omnifox/client.js +295 -0
- package/dist/omnifox/client.js.map +1 -0
- package/dist/omnifox/types.d.ts +53 -0
- package/dist/omnifox/types.d.ts.map +1 -0
- package/dist/omnifox/types.js +9 -0
- package/dist/omnifox/types.js.map +1 -0
- package/dist/server.d.ts +17 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +51 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/comments.d.ts +16 -0
- package/dist/tools/comments.d.ts.map +1 -0
- package/dist/tools/comments.js +31 -0
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/contacts.d.ts +11 -0
- package/dist/tools/contacts.d.ts.map +1 -0
- package/dist/tools/contacts.js +84 -0
- package/dist/tools/contacts.js.map +1 -0
- package/dist/tools/conversations.d.ts +13 -0
- package/dist/tools/conversations.d.ts.map +1 -0
- package/dist/tools/conversations.js +91 -0
- package/dist/tools/conversations.js.map +1 -0
- package/dist/tools/extras.d.ts +12 -0
- package/dist/tools/extras.d.ts.map +1 -0
- package/dist/tools/extras.js +105 -0
- package/dist/tools/extras.js.map +1 -0
- package/dist/tools/messaging.d.ts +18 -0
- package/dist/tools/messaging.d.ts.map +1 -0
- package/dist/tools/messaging.js +127 -0
- package/dist/tools/messaging.js.map +1 -0
- package/dist/tools/workspace.d.ts +12 -0
- package/dist/tools/workspace.d.ts.map +1 -0
- package/dist/tools/workspace.js +110 -0
- package/dist/tools/workspace.js.map +1 -0
- package/dist/transport/http.d.ts +12 -0
- package/dist/transport/http.d.ts.map +1 -0
- package/dist/transport/http.js +65 -0
- package/dist/transport/http.js.map +1 -0
- package/dist/transport/stdio.d.ts +6 -0
- package/dist/transport/stdio.d.ts.map +1 -0
- package/dist/transport/stdio.js +12 -0
- package/dist/transport/stdio.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP transport — POST /mcp + GET /health.
|
|
3
|
+
*
|
|
4
|
+
* Uses the SDK's StreamableHTTPServerTransport in stateless mode so the same
|
|
5
|
+
* express process can fan out across MCP clients (e.g. Composio, k8s).
|
|
6
|
+
*/
|
|
7
|
+
import express from "express";
|
|
8
|
+
import cors from "cors";
|
|
9
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
10
|
+
import { SERVER_NAME, SERVER_VERSION } from "../server.js";
|
|
11
|
+
export async function startHttp(serverFactory, opts = {}) {
|
|
12
|
+
const port = opts.port ?? (Number(process.env.PORT) || 8080);
|
|
13
|
+
const app = express();
|
|
14
|
+
app.use(cors({ origin: "*", exposedHeaders: ["Mcp-Session-Id"] }));
|
|
15
|
+
app.use(express.json({ limit: "4mb" }));
|
|
16
|
+
app.get("/health", (_req, res) => {
|
|
17
|
+
res.status(200).json({
|
|
18
|
+
status: "ok",
|
|
19
|
+
service: SERVER_NAME,
|
|
20
|
+
version: SERVER_VERSION,
|
|
21
|
+
timestamp: new Date().toISOString(),
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
// Stateless: each POST /mcp gets its own server + transport pair.
|
|
25
|
+
app.post("/mcp", async (req, res) => {
|
|
26
|
+
try {
|
|
27
|
+
const server = serverFactory();
|
|
28
|
+
const transport = new StreamableHTTPServerTransport({
|
|
29
|
+
sessionIdGenerator: undefined, // stateless: no session reuse
|
|
30
|
+
enableJsonResponse: true,
|
|
31
|
+
});
|
|
32
|
+
res.on("close", () => {
|
|
33
|
+
transport.close().catch(() => { });
|
|
34
|
+
server.close().catch(() => { });
|
|
35
|
+
});
|
|
36
|
+
await server.connect(transport);
|
|
37
|
+
await transport.handleRequest(req, res, req.body);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
process.stderr.write(`[omnifox-mcp-server] http error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
41
|
+
if (!res.headersSent) {
|
|
42
|
+
res.status(500).json({
|
|
43
|
+
jsonrpc: "2.0",
|
|
44
|
+
error: {
|
|
45
|
+
code: -32603,
|
|
46
|
+
message: "Internal MCP server error",
|
|
47
|
+
},
|
|
48
|
+
id: null,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
// GET /mcp + DELETE /mcp are not used in stateless mode.
|
|
54
|
+
app.get("/mcp", (_req, res) => {
|
|
55
|
+
res.status(405).json({
|
|
56
|
+
jsonrpc: "2.0",
|
|
57
|
+
error: { code: -32000, message: "Method not allowed in stateless mode." },
|
|
58
|
+
id: null,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
app.listen(port, () => {
|
|
62
|
+
process.stderr.write(`[omnifox-mcp-server] http transport listening on :${port} (POST /mcp, GET /health)\n`);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/transport/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,OAAwC,MAAM,SAAS,CAAC;AAC/D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAM3D,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,aAA8B,EAC9B,OAAoB,EAAE;IAEtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,C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S,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAsB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stdio transport — used by Claude Desktop, Cursor, Continue, etc.
|
|
3
|
+
*/
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
export async function startStdio(server) {
|
|
6
|
+
const transport = new StdioServerTransport();
|
|
7
|
+
await server.connect(transport);
|
|
8
|
+
// Stdio servers stay alive while stdin/stdout pipes are open.
|
|
9
|
+
// Log to stderr so we don't pollute the MCP framing channel.
|
|
10
|
+
process.stderr.write("[omnifox-mcp-server] stdio transport ready\n");
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=stdio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/transport/stdio.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGjF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAiB;IAChD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,8DAA8D;IAC9D,6DAA6D;IAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;AACvE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@omnifox/mcp-server",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Official Omnifox.io Model Context Protocol (MCP) server \u2014 48 tools over the Omnifox v1 REST API for Claude, Cursor, Continue and any MCP client. Every tool verified end-to-end against a live workspace.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"author": "Omnifox.io",
|
|
8
|
+
"homepage": "https://omnifox.io",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/omnifox-io/omnifox"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"mcp",
|
|
15
|
+
"model-context-protocol",
|
|
16
|
+
"omnifox",
|
|
17
|
+
"respond.io",
|
|
18
|
+
"whatsapp",
|
|
19
|
+
"instagram",
|
|
20
|
+
"messenger",
|
|
21
|
+
"customer-messaging",
|
|
22
|
+
"claude",
|
|
23
|
+
"cursor",
|
|
24
|
+
"ai-agent"
|
|
25
|
+
],
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"bin": {
|
|
29
|
+
"omnifox-mcp-server": "dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
".env.example"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"start": "node dist/index.js",
|
|
40
|
+
"dev": "tsc --watch",
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
42
|
+
"test": "node --test --import tsx tests/**/*.test.ts",
|
|
43
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build",
|
|
44
|
+
"test:e2e": "npm run build && node tests/e2e.mjs"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
48
|
+
"express": "^5.2.1",
|
|
49
|
+
"cors": "^2.8.5",
|
|
50
|
+
"zod": "^4.4.3"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/cors": "^2.8.17",
|
|
54
|
+
"@types/express": "^5.0.0",
|
|
55
|
+
"@types/node": "^22.10.0",
|
|
56
|
+
"tsx": "^4.19.0",
|
|
57
|
+
"typescript": "^5.7.0"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=18.17.0"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
}
|
|
65
|
+
}
|