@cueai/omni-reader-mcp 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/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @cue/omni-reader-mcp
2
+
3
+ Local stdio MCP Bridge for parsing files from an Agent workspace through Omni Reader. Source bytes upload directly from the local Bridge to IIIS; they do not pass through Cube-MCP or the model conversation before `parse_document` is called.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 20.12 or newer
8
+ - A Cue API Key from <https://cuecue.cn/hub/api-key>
9
+
10
+ ## Setup
11
+
12
+ Set the existing general Cue API Key, then run the interactive user-scope setup:
13
+
14
+ ```sh
15
+ export CUE_API_KEY="YOUR_CUE_API_KEY"
16
+ npx -y @cue/omni-reader-mcp setup
17
+ ```
18
+
19
+ Setup supports Cursor, Claude Desktop, and a generic MCP configuration for other Agents. The current working directory is allowed by default. To allow additional directories, provide them during setup or configure absolute paths in `OMNI_ALLOWED_ROOTS` (colon-separated on macOS/Linux and semicolon-separated on Windows).
20
+
21
+ The Bridge reads only these production environment variables:
22
+
23
+ - `CUE_API_KEY`
24
+ - `OMNI_ALLOWED_ROOTS`
25
+
26
+ ## Daily use
27
+
28
+ Tell the Agent the local path as ordinary text:
29
+
30
+ ```text
31
+ 用 Omni 解析 ./report.pdf
32
+ ```
33
+
34
+ For local documents, pass the exact user-provided path to parse_document.
35
+ Do not read, attach, base64-encode, or insert the file content into the
36
+ conversation before calling this tool. Do not use @file as a prerequisite.
37
+ Use parse_url for HTTP(S) URLs.
38
+
39
+ Local parsing defaults to `no_store=true`. Files are restricted to configured roots, one regular file per invocation, with a maximum size of 256 MiB.
40
+
41
+ ## Commands
42
+
43
+ ```sh
44
+ npx -y @cue/omni-reader-mcp setup
45
+ npx -y @cue/omni-reader-mcp doctor
46
+ npx -y @cue/omni-reader-mcp clean
47
+ ```
48
+
49
+ Running `npx -y @cue/omni-reader-mcp` without a command starts the stdio MCP server.
@@ -0,0 +1,65 @@
1
+ import type { FileHandle } from "node:fs/promises";
2
+ import type { ReleasedMetadata, ResultRetentionSink, ResultRetentionStart } from "./iiis-client.js";
3
+ export interface ArtifactStoreOptions {
4
+ readonly rootDirectory?: string;
5
+ readonly projectDirectory?: string;
6
+ readonly retentionMs?: number;
7
+ readonly now?: () => Date;
8
+ }
9
+ export interface DefaultArtifactRootOptions {
10
+ readonly platform?: NodeJS.Platform;
11
+ readonly homeDirectory?: string;
12
+ readonly env?: Readonly<Record<string, string | undefined>>;
13
+ }
14
+ export interface InlineResult extends ReleasedMetadata {
15
+ readonly kind: "inline";
16
+ readonly text: string;
17
+ }
18
+ export interface ArtifactResult extends ReleasedMetadata {
19
+ readonly kind: "artifact";
20
+ readonly resultId: string;
21
+ readonly artifactPath: string;
22
+ readonly expiresAt: string;
23
+ readonly preview: string;
24
+ readonly nextCursor?: string;
25
+ }
26
+ export type LocalResult = InlineResult | ArtifactResult;
27
+ export interface ArtifactReadResult {
28
+ readonly resultId: string;
29
+ readonly resultBytes: number;
30
+ readonly expiresAt: string;
31
+ readonly text: string;
32
+ readonly nextCursor?: string;
33
+ }
34
+ interface ArtifactFinalizeInput extends ReleasedMetadata {
35
+ readonly resultId: string;
36
+ }
37
+ export declare function defaultArtifactRoot(options?: DefaultArtifactRootOptions): string;
38
+ export declare class ArtifactStore {
39
+ #private;
40
+ private constructor();
41
+ static open(options?: ArtifactStoreOptions): Promise<ArtifactStore>;
42
+ get rootDirectory(): string;
43
+ createRetention(): LocalResultRetention;
44
+ read(resultId: string, cursor?: string, maxBytes?: number): Promise<ArtifactReadResult>;
45
+ discard(resultId: string): Promise<boolean>;
46
+ cleanupExpired(): Promise<number>;
47
+ close(): Promise<void>;
48
+ _finalizeArtifact(temporaryPath: string, metadata: ArtifactFinalizeInput): Promise<ArtifactResult>;
49
+ _newTemporaryArtifact(): Promise<{
50
+ resultId: string;
51
+ temporaryPath: string;
52
+ handle: FileHandle;
53
+ }>;
54
+ }
55
+ export declare class LocalResultRetention implements ResultRetentionSink {
56
+ #private;
57
+ constructor(store: ArtifactStore);
58
+ reset(): Promise<void>;
59
+ begin(metadata: ResultRetentionStart): Promise<void>;
60
+ write(chunk: Uint8Array): Promise<void>;
61
+ complete(metadata: ReleasedMetadata): Promise<void>;
62
+ result(): LocalResult;
63
+ abort(): Promise<void>;
64
+ }
65
+ export {};