@apiwings/mcp 0.1.0 → 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/README.md CHANGED
@@ -16,7 +16,11 @@ MCP server for [APIWings](https://apiwings.com): lets Claude, Cursor or any MCP
16
16
  | `get_post` / `list_posts` | Status, URL, visibility and error per network |
17
17
  | `cancel_post` | Cancel a scheduled post that has not started |
18
18
 
19
- ## Setup
19
+ ## Remote server (nothing to install)
20
+
21
+ APIWings also runs this server for you at `https://mcp.apiwings.com/mcp`. Add that URL to Claude (Settings → Connectors → Add custom connector), Claude Code (`claude mcp add --transport http apiwings https://mcp.apiwings.com/mcp`) or Cursor, and sign in to APIWings. See the [MCP guide](https://apiwings.com/docs/mcp).
22
+
23
+ ## Local setup (this package)
20
24
 
21
25
  Create an API key in the APIWings dashboard under **API keys**. Start with a test key (`aw_test_`): the agent can try everything and nothing is posted. The key goes in the server's environment, never in the conversation.
22
26
 
package/dist/index.js CHANGED
@@ -2,15 +2,13 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { ApiWings } from "@apiwings/sdk";
5
- import { buildTools, runTool } from "./tools.js";
5
+ import { buildTools, registerTools } from "./tools.js";
6
6
  const apiKey = process.env.APIWINGS_API_KEY;
7
7
  if (!apiKey) {
8
8
  console.error("APIWINGS_API_KEY is required (aw_live_… or aw_test_…). Optional: APIWINGS_BASE_URL.");
9
9
  process.exit(1);
10
10
  }
11
- const server = new McpServer({ name: "apiwings", version: "0.1.0" });
12
- for (const t of buildTools(new ApiWings({ apiKey, baseUrl: process.env.APIWINGS_BASE_URL }))) {
13
- server.tool(t.name, t.description, t.schema, (args) => runTool(t, args));
14
- }
11
+ const server = new McpServer({ name: "apiwings", version: "0.2.0" });
12
+ registerTools(server, buildTools(new ApiWings({ apiKey, baseUrl: process.env.APIWINGS_BASE_URL })));
15
13
  await server.connect(new StdioServerTransport());
16
14
  //# sourceMappingURL=index.js.map
package/dist/tools.d.ts CHANGED
@@ -84,3 +84,20 @@ export declare function runTool(t: ReturnType<typeof buildTools>[number], args:
84
84
  text: string;
85
85
  }[];
86
86
  }>;
87
+ type Annotations = {
88
+ readOnlyHint?: boolean;
89
+ destructiveHint?: boolean;
90
+ idempotentHint?: boolean;
91
+ openWorldHint?: boolean;
92
+ };
93
+ /**
94
+ * Title and hints of every tool (MCP tool annotations; required by Claude's connectors directory):
95
+ * read-only tools can run without asking, and publishing or cancelling is flagged so clients confirm first.
96
+ */
97
+ export declare const TOOL_META: Record<string, {
98
+ title: string;
99
+ annotations: Annotations;
100
+ }>;
101
+ /** Registers the tools on an McpServer with their titles and annotations (local stdio server and the remote /mcp) */
102
+ export declare function registerTools(server: unknown, tools: ReturnType<typeof buildTools>): void;
103
+ export {};
package/dist/tools.js CHANGED
@@ -149,4 +149,31 @@ export async function runTool(t, args) {
149
149
  return { isError: true, content: [{ type: "text", text }] };
150
150
  }
151
151
  }
152
+ /**
153
+ * Title and hints of every tool (MCP tool annotations; required by Claude's connectors directory):
154
+ * read-only tools can run without asking, and publishing or cancelling is flagged so clients confirm first.
155
+ */
156
+ export const TOOL_META = {
157
+ list_profiles: { title: "List profiles", annotations: { readOnlyHint: true, openWorldHint: false } },
158
+ create_profile: { title: "Create a profile", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false } },
159
+ connect: { title: "Get a link to connect an account", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false } },
160
+ list_accounts: { title: "List connected accounts", annotations: { readOnlyHint: true, openWorldHint: false } },
161
+ publish_options: { title: "Get a network's posting options", annotations: { readOnlyHint: true, openWorldHint: true } },
162
+ upload_media: { title: "Upload a local file", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false } },
163
+ validate_post: { title: "Check a post without publishing", annotations: { readOnlyHint: true, openWorldHint: false } },
164
+ create_post: { title: "Publish or schedule a post", annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true } },
165
+ get_post: { title: "Get a post's status", annotations: { readOnlyHint: true, openWorldHint: false } },
166
+ list_posts: { title: "List recent posts", annotations: { readOnlyHint: true, openWorldHint: false } },
167
+ cancel_post: { title: "Cancel a scheduled post", annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false } },
168
+ };
169
+ /** Registers the tools on an McpServer with their titles and annotations (local stdio server and the remote /mcp) */
170
+ export function registerTools(server, tools) {
171
+ const s = server;
172
+ for (const t of tools) {
173
+ const meta = TOOL_META[t.name];
174
+ if (!meta)
175
+ throw new Error(`Tool ${t.name} has no title and annotations in TOOL_META`);
176
+ s.registerTool(t.name, { title: meta.title, description: t.description, inputSchema: t.schema, annotations: { title: meta.title, ...meta.annotations } }, (args) => runTool(t, args));
177
+ }
178
+ }
152
179
  //# sourceMappingURL=tools.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apiwings/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "MCP server for APIWings: connect accounts, upload media, publish and read posts",
5
5
  "keywords": [
6
6
  "apiwings",