@neopress/mcp 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/README.md +116 -0
- package/dist/bin.cjs +32064 -0
- package/dist/http-bin.cjs +34058 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +33999 -0
- package/integrations/README.md +55 -0
- package/integrations/chatgpt/app-draft.md +96 -0
- package/integrations/claude-code/setup.md +32 -0
- package/integrations/claude-desktop/manifest.json +100 -0
- package/integrations/claude-remote/connector-draft.md +73 -0
- package/integrations/codex/config.example.toml +13 -0
- package/package.json +45 -0
- package/scripts/deploy-cloud-run.sh +183 -0
- package/scripts/prepare-mcpb-package.mjs +55 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { ServerRequest, ServerNotification } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
4
|
+
import { NeopressClient } from './client.js';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { Server } from 'node:http';
|
|
7
|
+
import { AddressInfo } from 'node:net';
|
|
8
|
+
|
|
9
|
+
interface ClientOptions {
|
|
10
|
+
siteId?: number;
|
|
11
|
+
requireSite?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ToolContext {
|
|
15
|
+
createClient(options?: ClientOptions, extra?: ToolRequestExtra): Promise<NeopressClient>;
|
|
16
|
+
readFile(filePath: string): Buffer;
|
|
17
|
+
stat(filePath: string): {
|
|
18
|
+
size: number;
|
|
19
|
+
};
|
|
20
|
+
fetch: typeof fetch;
|
|
21
|
+
setActiveSiteId(siteId: number, extra?: ToolRequestExtra): void;
|
|
22
|
+
getBaseUrl(): string;
|
|
23
|
+
}
|
|
24
|
+
interface NeopressToolDefinition {
|
|
25
|
+
name: string;
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
inputSchema: Record<string, z.ZodTypeAny>;
|
|
29
|
+
handler(input: Record<string, unknown>, context: ToolContext, extra?: ToolRequestExtra): Promise<unknown>;
|
|
30
|
+
}
|
|
31
|
+
type ToolRequestExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
|
|
32
|
+
declare const toolDefinitions: NeopressToolDefinition[];
|
|
33
|
+
declare function registerNeopressTools(server: McpServer, context?: ToolContext, options?: {
|
|
34
|
+
disabledTools?: Iterable<string>;
|
|
35
|
+
}): void;
|
|
36
|
+
|
|
37
|
+
interface NeopressMcpServerOptions {
|
|
38
|
+
toolContext?: ToolContext;
|
|
39
|
+
disabledTools?: Iterable<string>;
|
|
40
|
+
}
|
|
41
|
+
declare function createNeopressMcpServer(options?: NeopressMcpServerOptions): McpServer;
|
|
42
|
+
|
|
43
|
+
interface RemoteSiteSelectionStore {
|
|
44
|
+
get(userKey: string): number | undefined;
|
|
45
|
+
set(userKey: string, siteId: number): void;
|
|
46
|
+
}
|
|
47
|
+
interface RemoteToolContextOptions {
|
|
48
|
+
baseUrl: string;
|
|
49
|
+
siteSelectionStore?: RemoteSiteSelectionStore;
|
|
50
|
+
}
|
|
51
|
+
declare function createMemoryRemoteSiteSelectionStore(): RemoteSiteSelectionStore;
|
|
52
|
+
declare function createRemoteToolContext(options: RemoteToolContextOptions): ToolContext;
|
|
53
|
+
|
|
54
|
+
type RemoteMcpAuthMode = 'oauth' | 'none';
|
|
55
|
+
interface NeopressMcpHttpServerOptions {
|
|
56
|
+
authMode?: RemoteMcpAuthMode;
|
|
57
|
+
baseUrl?: string;
|
|
58
|
+
corsOrigins?: string[] | '*';
|
|
59
|
+
fetch?: typeof fetch;
|
|
60
|
+
host?: string;
|
|
61
|
+
oauthClientSecret?: string;
|
|
62
|
+
oauthProvider?: string;
|
|
63
|
+
port?: number;
|
|
64
|
+
publicUrl?: string;
|
|
65
|
+
siteSelectionStore?: RemoteSiteSelectionStore;
|
|
66
|
+
supabaseAnonKey?: string;
|
|
67
|
+
supabaseUrl?: string;
|
|
68
|
+
}
|
|
69
|
+
interface NeopressMcpHttpServer {
|
|
70
|
+
address(): AddressInfo | string | null;
|
|
71
|
+
close(): Promise<void>;
|
|
72
|
+
listen(port?: number, host?: string): Promise<AddressInfo | string | null>;
|
|
73
|
+
server: Server;
|
|
74
|
+
}
|
|
75
|
+
declare function createNeopressMcpHttpServer(rawOptions?: NeopressMcpHttpServerOptions): NeopressMcpHttpServer;
|
|
76
|
+
|
|
77
|
+
export { type NeopressMcpHttpServer, type NeopressMcpHttpServerOptions, type NeopressMcpServerOptions, type NeopressToolDefinition, type RemoteMcpAuthMode, type ToolContext, type ToolRequestExtra, createMemoryRemoteSiteSelectionStore, createNeopressMcpHttpServer, createNeopressMcpServer, createRemoteToolContext, registerNeopressTools, toolDefinitions };
|