Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/highstory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# High Story MCP Server
This server allows Claude to interact with [High Story](https://highstory.io).
64 changes: 64 additions & 0 deletions src/highstory/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

const server = new McpServer({
name: "High Story",
version: "1.0.0"
});

const API_BASE_URL = "https://jeprtikkylotvcddrqvm.supabase.co/functions/v1";

/**
* Helper to call High Story Edge Functions
*/
async function callHighStoryAPI(endpoint: string, payload: any) {
const apiKey = process.env.HIGHSTORY_API_KEY;
if (!apiKey) {
throw new Error("Missing HIGHSTORY_API_KEY environment variable. Please generate one in your High Story settings.");
}

const response = await fetch(`${API_BASE_URL}/${endpoint}`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});

if (!response.ok) {
const error = await response.json();
throw new Error(error.error || `API Error: ${response.statusText}`);
}

return await response.json();
}

// --- Tools Implementation ---

server.tool(
"execute_campaign",
"Create and execute an AI content campaign for a brand. Generates social media posts based on brand analysis.",
{
brand_url: z.string().optional().describe("The brand website URL (optional)"),
campaign_objective: z.string().describe("The campaign goal"),
workspace_id: z.string().optional().describe("High Story workspace ID (optional)"),
},
async (args) => {
try {
const data = await callHighStoryAPI('execute-campaign', {
...args,
is_onboarding: false
});
return { content: [{ type: "text", text: `Campaign started successfully! View it in your dashboard.` }] };
} catch (e: any) {
return { isError: true, content: [{ type: "text", text: `Error: ${e.message}` }] };
}
}
);

// --- Entry Point ---

const transport = new StdioServerTransport();
await server.connect(transport);
23 changes: 23 additions & 0 deletions src/highstory/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@modelcontextprotocol/server-highstory",
"version": "1.0.0",
"description": "High Story MCP server for AI-driven social media automation",
"license": "MIT",
"type": "module",
"bin": {
"mcp-server-highstory": "dist/index.js"
},
"scripts": {
"build": "tsc && shx chmod +x dist/index.js",
"prepare": "npm run build"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.26.0",
"zod": "^3.25.0"
},
"devDependencies": {
"@types/node": "^22.10.2",
"shx": "^0.3.4",
"typescript": "^5.6.2"
}
}
10 changes: 10 additions & 0 deletions src/highstory/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "."
},
"include": [
"./**/*.ts"
]
}
Loading