@ttoss/http-server-mcp 0.8.0 → 0.10.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 +3 -11
- package/dist/esm/index.js +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,11 +12,7 @@ pnpm add @ttoss/http-server-mcp
|
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { App, bodyParser, cors } from '@ttoss/http-server';
|
|
15
|
-
import {
|
|
16
|
-
createMcpRouter,
|
|
17
|
-
Server as McpServer,
|
|
18
|
-
z,
|
|
19
|
-
} from '@ttoss/http-server-mcp';
|
|
15
|
+
import { createMcpRouter, McpServer, z } from '@ttoss/http-server-mcp';
|
|
20
16
|
|
|
21
17
|
// Create MCP server
|
|
22
18
|
const mcpServer = new McpServer({
|
|
@@ -66,11 +62,7 @@ Use `getApiHeaders` in `createMcpRouter` to configure which headers from the inc
|
|
|
66
62
|
### Bearer token forwarding
|
|
67
63
|
|
|
68
64
|
```typescript
|
|
69
|
-
import {
|
|
70
|
-
apiCall,
|
|
71
|
-
createMcpRouter,
|
|
72
|
-
Server as McpServer,
|
|
73
|
-
} from '@ttoss/http-server-mcp';
|
|
65
|
+
import { apiCall, createMcpRouter, McpServer } from '@ttoss/http-server-mcp';
|
|
74
66
|
|
|
75
67
|
const mcpServer = new McpServer({ name: 'my-server', version: '1.0.0' });
|
|
76
68
|
|
|
@@ -170,7 +162,7 @@ Generic HTTP helper for use inside MCP tool handlers.
|
|
|
170
162
|
### Basic Tool
|
|
171
163
|
|
|
172
164
|
```typescript
|
|
173
|
-
import {
|
|
165
|
+
import { McpServer, z } from '@ttoss/http-server-mcp';
|
|
174
166
|
|
|
175
167
|
const server = new McpServer({
|
|
176
168
|
name: 'calculator',
|
package/dist/esm/index.js
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _koa_router from '@koa/router';
|
|
|
2
2
|
import * as koa from 'koa';
|
|
3
3
|
import { Context } from 'koa';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
export { McpServer
|
|
5
|
+
export { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
6
|
export { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -40,7 +40,7 @@ interface ApiCallOptions {
|
|
|
40
40
|
*
|
|
41
41
|
* @example Bearer token forwarding (configured once in `createMcpRouter`)
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import { apiCall, createMcpRouter,
|
|
43
|
+
* import { apiCall, createMcpRouter, McpServer } from '@ttoss/http-server-mcp';
|
|
44
44
|
*
|
|
45
45
|
* // Tool handler – no manual auth wiring needed
|
|
46
46
|
* mcpServer.registerTool('list-portfolios', { description: '...', inputSchema: {} }, async () => {
|
|
@@ -135,7 +135,7 @@ interface McpRouterOptions {
|
|
|
135
135
|
* @example
|
|
136
136
|
* ```typescript
|
|
137
137
|
* import { App, bodyParser } from '@ttoss/http-server';
|
|
138
|
-
* import { createMcpRouter,
|
|
138
|
+
* import { createMcpRouter, McpServer, z } from '@ttoss/http-server-mcp';
|
|
139
139
|
*
|
|
140
140
|
* const mcpServer = new McpServer({
|
|
141
141
|
* name: 'my-server',
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _koa_router from '@koa/router';
|
|
|
2
2
|
import * as koa from 'koa';
|
|
3
3
|
import { Context } from 'koa';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
export { McpServer
|
|
5
|
+
export { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
6
|
export { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -40,7 +40,7 @@ interface ApiCallOptions {
|
|
|
40
40
|
*
|
|
41
41
|
* @example Bearer token forwarding (configured once in `createMcpRouter`)
|
|
42
42
|
* ```typescript
|
|
43
|
-
* import { apiCall, createMcpRouter,
|
|
43
|
+
* import { apiCall, createMcpRouter, McpServer } from '@ttoss/http-server-mcp';
|
|
44
44
|
*
|
|
45
45
|
* // Tool handler – no manual auth wiring needed
|
|
46
46
|
* mcpServer.registerTool('list-portfolios', { description: '...', inputSchema: {} }, async () => {
|
|
@@ -135,7 +135,7 @@ interface McpRouterOptions {
|
|
|
135
135
|
* @example
|
|
136
136
|
* ```typescript
|
|
137
137
|
* import { App, bodyParser } from '@ttoss/http-server';
|
|
138
|
-
* import { createMcpRouter,
|
|
138
|
+
* import { createMcpRouter, McpServer, z } from '@ttoss/http-server-mcp';
|
|
139
139
|
*
|
|
140
140
|
* const mcpServer = new McpServer({
|
|
141
141
|
* name: 'my-server',
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
31
31
|
// src/index.ts
|
|
32
32
|
var index_exports = {};
|
|
33
33
|
__export(index_exports, {
|
|
34
|
-
|
|
34
|
+
McpServer: () => import_mcp.McpServer,
|
|
35
35
|
apiCall: () => apiCall,
|
|
36
36
|
createMcpRouter: () => createMcpRouter,
|
|
37
37
|
z: () => import_zod.z
|
|
@@ -180,7 +180,7 @@ var createMcpRouter = /* @__PURE__ */__name((server, options = {}) => {
|
|
|
180
180
|
}, "createMcpRouter");
|
|
181
181
|
// Annotate the CommonJS export names for ESM import in node:
|
|
182
182
|
0 && (module.exports = {
|
|
183
|
-
|
|
183
|
+
McpServer,
|
|
184
184
|
apiCall,
|
|
185
185
|
createMcpRouter,
|
|
186
186
|
z
|