@olane/o-mcp 0.8.3 → 0.8.5

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
@@ -47,20 +47,10 @@ await mcpBridge.use({
47
47
 
48
48
  ### Why Use o-mcp?
49
49
 
50
- <CardGroup cols={2}>
51
- <Card title="Unified Interface" icon="plug" color="#0D9373">
52
- Use MCP servers alongside native Olane tools through the same `o://` addressing
53
- </Card>
54
- <Card title="Network Discovery" icon="magnifying-glass" color="#0D9373">
55
- MCP tools indexed in vector store for semantic search
56
- </Card>
57
- <Card title="Intent Preservation" icon="brain" color="#0D9373">
58
- Maintains execution context across MCP boundaries
59
- </Card>
60
- <Card title="Instant Integration" icon="rocket" color="#0D9373">
61
- Add existing MCP servers without code changes
62
- </Card>
63
- </CardGroup>
50
+ - **Unified Interface**: Use MCP servers alongside native Olane tools through the same `o://` addressing
51
+ - **Network Discovery**: MCP tools indexed in vector store for semantic search
52
+ - **Intent Preservation**: Maintains execution context across MCP boundaries
53
+ - **Instant Integration**: Add existing MCP servers without code changes
64
54
 
65
55
  ---
66
56
 
@@ -69,7 +59,7 @@ await mcpBridge.use({
69
59
  ### Installation
70
60
 
71
61
  ```bash
72
- npm install @olane/o-mcp
62
+ pnpm install @olane/o-mcp
73
63
  ```
74
64
 
75
65
  ### Basic Usage
@@ -245,6 +235,8 @@ await bridge.use({
245
235
 
246
236
  Search for MCP servers using AI-powered search.
247
237
 
238
+ > **Dependency**: This tool requires `o://perplexity` to be available in the network. Ensure a Perplexity tool node is registered before using search.
239
+
248
240
  **Parameters:**
249
241
  - `name` (string, optional): MCP server name
250
242
  - `provider` (string, optional): Provider/creator name
@@ -256,7 +248,7 @@ Search for MCP servers using AI-powered search.
256
248
  **Example:**
257
249
  ```typescript
258
250
  // Search for Slack MCP server
259
- const result = await bridge.use({
251
+ const response = await bridge.use({
260
252
  method: 'search',
261
253
  params: {
262
254
  provider: 'Slack',
@@ -264,8 +256,10 @@ const result = await bridge.use({
264
256
  }
265
257
  });
266
258
 
267
- console.log(result.result);
268
- // Returns instructions on how to connect to Slack MCP
259
+ if (response.result.success) {
260
+ console.log(response.result.data);
261
+ // Returns instructions on how to connect to Slack MCP
262
+ }
269
263
  ```
270
264
 
271
265
  ---
@@ -274,6 +268,8 @@ console.log(result.result);
274
268
 
275
269
  Validate whether a URL points to a valid MCP server.
276
270
 
271
+ > **Dependency**: This tool requires `o://perplexity` to be available in the network. Ensure a Perplexity tool node is registered before using validate_url.
272
+
277
273
  **Parameters:**
278
274
  - `mcpServerUrl` (string, required): URL to validate
279
275
 
@@ -282,15 +278,17 @@ Validate whether a URL points to a valid MCP server.
282
278
 
283
279
  **Example:**
284
280
  ```typescript
285
- const validation = await bridge.use({
281
+ const response = await bridge.use({
286
282
  method: 'validate_url',
287
283
  params: {
288
284
  mcpServerUrl: 'https://example.com/mcp'
289
285
  }
290
286
  });
291
287
 
292
- console.log(validation.result);
293
- // "Yes, this is a valid MCP server providing..."
288
+ if (response.result.success) {
289
+ console.log(response.result.data);
290
+ // "Yes, this is a valid MCP server providing..."
291
+ }
294
292
  ```
295
293
 
296
294
  ---
@@ -419,7 +417,9 @@ const repos = await bridge.use(new oAddress('o://github'), {
419
417
  params: { organization: 'olane-labs' }
420
418
  });
421
419
 
422
- console.log(repos);
420
+ if (repos.result.success) {
421
+ console.log(repos.result.data);
422
+ }
423
423
  ```
424
424
 
425
425
  ---
@@ -581,13 +581,17 @@ const client = new oClient(
581
581
 
582
582
  ```typescript
583
583
  // Use validate_url to test connection first
584
- const validation = await bridge.use({
584
+ const response = await bridge.use({
585
585
  method: 'validate_url',
586
586
  params: { mcpServerUrl: 'https://mcp.example.com' }
587
587
  });
588
588
 
589
- console.log(validation.result);
590
- // If validation fails, check URL and network
589
+ if (response.result.success) {
590
+ console.log(response.result.data);
591
+ } else {
592
+ console.error('Validation failed:', response.result.error);
593
+ // Check URL and network connectivity
594
+ }
591
595
  ```
592
596
 
593
597
  ---
@@ -611,7 +615,9 @@ const whoami = await bridge.use(new oAddress('o://mcp_server_name'), {
611
615
  params: {}
612
616
  });
613
617
 
614
- console.log(whoami.tools); // Should list all MCP tools
618
+ if (whoami.result.success) {
619
+ console.log(whoami.result.data.tools); // Should list all MCP tools
620
+ }
615
621
  ```
616
622
 
617
623
  ---
@@ -669,9 +675,9 @@ When you add an MCP server, it becomes a **child node** of the bridge:
669
675
 
670
676
  ```
671
677
  o://mcp-bridge (McpBridgeTool)
672
- ├── o://github (McpTool wrapping GitHub MCP)
673
- ├── o://slack (McpTool wrapping Slack MCP)
674
- └── o://filesystem (McpTool wrapping Filesystem MCP)
678
+ ├── o://mcp-bridge/github (McpTool wrapping GitHub MCP)
679
+ ├── o://mcp-bridge/slack (McpTool wrapping Slack MCP)
680
+ └── o://mcp-bridge/filesystem (McpTool wrapping Filesystem MCP)
675
681
  ```
676
682
 
677
683
  Each child node (`McpTool`) is a complete Olane tool node with:
@@ -679,6 +685,24 @@ Each child node (`McpTool`) is a complete Olane tool node with:
679
685
  - Discoverable tools in the network
680
686
  - Standard Olane tool interface
681
687
 
688
+ #### Child Node Address Nesting
689
+
690
+ Child `McpTool` nodes are created with **simple addresses** and linked to the bridge via `parent`. The system automatically creates the nested address during registration:
691
+
692
+ ```typescript
693
+ // Internally, McpBridgeTool creates children like this:
694
+ const mcpTool = new McpTool({
695
+ address: new oAddress(`o://${name}`), // Simple address
696
+ parent: this.address, // Parent linkage
697
+ leader: this.leader,
698
+ mcpClient: client,
699
+ });
700
+
701
+ // After start(), mcpTool.address becomes 'o://mcp-bridge/{name}'
702
+ ```
703
+
704
+ > **Important**: Never construct nested addresses manually (e.g., `new oAddress('o://mcp-bridge/github')`). Always use simple addresses with `parent` linkage and let the system create the hierarchy at runtime.
705
+
682
706
  ---
683
707
 
684
708
  ### Intent Metadata Flow
@@ -714,6 +738,43 @@ This enables:
714
738
 
715
739
  ---
716
740
 
741
+ ### Response Structure {#response-structure}
742
+
743
+ All `use()` calls return responses following the standard Olane response wrapping pattern:
744
+
745
+ ```typescript
746
+ const response = await bridge.use({
747
+ method: 'add_remote_server',
748
+ params: {
749
+ mcpServerUrl: 'https://mcp.example.com',
750
+ name: 'example',
751
+ description: 'Example MCP server'
752
+ }
753
+ });
754
+
755
+ // Response structure:
756
+ // {
757
+ // jsonrpc: "2.0",
758
+ // id: "request-id",
759
+ // result: {
760
+ // success: boolean, // Whether the operation succeeded
761
+ // data: any, // The returned data (on success)
762
+ // error?: string // Error details (on failure)
763
+ // }
764
+ // }
765
+
766
+ // Always check success before accessing data
767
+ if (response.result.success) {
768
+ console.log(response.result.data.message);
769
+ } else {
770
+ console.error('Error:', response.result.error);
771
+ }
772
+ ```
773
+
774
+ > **Important**: Access data via `response.result.data`, not `response.result` directly. Always check `response.result.success` before accessing `response.result.data`.
775
+
776
+ ---
777
+
717
778
  ## Real-World Examples {#real-world-examples}
718
779
 
719
780
  ### Example 1: Multi-MCP Research Assistant
@@ -850,20 +911,10 @@ const workflow = await devBridge.use({
850
911
 
851
912
  ## Next Steps {#next-steps}
852
913
 
853
- <CardGroup cols={2}>
854
- <Card title="Build Your First Node" icon="hammer" href="/guides/quickstart">
855
- Learn Olane fundamentals
856
- </Card>
857
- <Card title="Explore MCP Servers" icon="server" href="https://github.com/modelcontextprotocol/servers">
858
- Find existing MCP servers
859
- </Card>
860
- <Card title="Package Combinations" icon="box" href="/packages/package-combinations">
861
- Choose the right packages
862
- </Card>
863
- <Card title="o-lane Documentation" icon="brain" href="/packages/o-lane">
864
- Learn intent-driven execution
865
- </Card>
866
- </CardGroup>
914
+ - **[Build Your First Node](/guides/quickstart)** - Learn Olane fundamentals
915
+ - **[Explore MCP Servers](https://github.com/modelcontextprotocol/servers)** - Find existing MCP servers
916
+ - **[Package Combinations](/packages/package-combinations)** - Choose the right packages
917
+ - **[o-lane Documentation](/packages/o-lane)** - Learn intent-driven execution
867
918
 
868
919
  ---
869
920
 
@@ -1,3 +1,5 @@
1
1
  export * from './mcp-bridge.tool.js';
2
2
  export * from './mcp.tool.js';
3
+ export * from './o-client.mcp.js';
4
+ export * from './o-server.mcp.js';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './mcp-bridge.tool.js';
2
2
  export * from './mcp.tool.js';
3
+ export * from './o-client.mcp.js';
4
+ export * from './o-server.mcp.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-mcp",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -35,15 +35,15 @@
35
35
  "description": "oLane Core",
36
36
  "dependencies": {
37
37
  "@modelcontextprotocol/sdk": "^1.18.1",
38
- "@olane/o-config": "0.8.3",
39
- "@olane/o-core": "0.8.3",
40
- "@olane/o-intelligence": "0.8.3",
41
- "@olane/o-lane": "0.8.3",
42
- "@olane/o-leader": "0.8.3",
43
- "@olane/o-node": "0.8.3",
44
- "@olane/o-protocol": "0.8.3",
45
- "@olane/o-storage": "0.8.3",
46
- "@olane/o-tool": "0.8.3",
38
+ "@olane/o-config": "0.8.5",
39
+ "@olane/o-core": "0.8.5",
40
+ "@olane/o-intelligence": "0.8.5",
41
+ "@olane/o-lane": "0.8.5",
42
+ "@olane/o-leader": "0.8.5",
43
+ "@olane/o-node": "0.8.5",
44
+ "@olane/o-protocol": "0.8.5",
45
+ "@olane/o-storage": "0.8.5",
46
+ "@olane/o-tool": "0.8.5",
47
47
  "debug": "^4.4.1",
48
48
  "dotenv": "^16.5.0",
49
49
  "express": "^4.21.2",
@@ -70,5 +70,5 @@
70
70
  "tsx": "^4.20.3",
71
71
  "typescript": "5.4.5"
72
72
  },
73
- "gitHead": "189c0cf7b6dd9d5d961f5424af21d37978092d9e"
73
+ "gitHead": "e88f1e55dcc92d9a410d28200e4220697116f82f"
74
74
  }