@mastra/mcp 0.11.3-alpha.1 → 0.11.3-alpha.2

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +16 -3
  3. package/.turbo/turbo-build.log +0 -4
  4. package/eslint.config.js +0 -11
  5. package/integration-tests/node_modules/.bin/tsc +0 -21
  6. package/integration-tests/node_modules/.bin/tsserver +0 -21
  7. package/integration-tests/node_modules/.bin/vitest +0 -21
  8. package/integration-tests/package.json +0 -29
  9. package/integration-tests/src/mastra/agents/weather.ts +0 -34
  10. package/integration-tests/src/mastra/index.ts +0 -15
  11. package/integration-tests/src/mastra/mcp/index.ts +0 -46
  12. package/integration-tests/src/mastra/tools/weather.ts +0 -13
  13. package/integration-tests/src/server.test.ts +0 -238
  14. package/integration-tests/tsconfig.json +0 -13
  15. package/integration-tests/vitest.config.ts +0 -14
  16. package/src/__fixtures__/fire-crawl-complex-schema.ts +0 -1013
  17. package/src/__fixtures__/server-weather.ts +0 -16
  18. package/src/__fixtures__/stock-price.ts +0 -128
  19. package/src/__fixtures__/tools.ts +0 -94
  20. package/src/__fixtures__/weather.ts +0 -269
  21. package/src/client/client.test.ts +0 -585
  22. package/src/client/client.ts +0 -628
  23. package/src/client/configuration.test.ts +0 -856
  24. package/src/client/configuration.ts +0 -468
  25. package/src/client/elicitationActions.ts +0 -26
  26. package/src/client/index.ts +0 -3
  27. package/src/client/promptActions.ts +0 -70
  28. package/src/client/resourceActions.ts +0 -119
  29. package/src/index.ts +0 -2
  30. package/src/server/index.ts +0 -2
  31. package/src/server/promptActions.ts +0 -48
  32. package/src/server/resourceActions.ts +0 -90
  33. package/src/server/server-logging.test.ts +0 -181
  34. package/src/server/server.test.ts +0 -2142
  35. package/src/server/server.ts +0 -1445
  36. package/src/server/types.ts +0 -59
  37. package/tsconfig.build.json +0 -9
  38. package/tsconfig.json +0 -5
  39. package/tsup.config.ts +0 -17
  40. package/vitest.config.ts +0 -8
@@ -1,59 +0,0 @@
1
- import type { InternalCoreTool } from '@mastra/core/tools';
2
- import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
3
- import type {
4
- ElicitRequest,
5
- ElicitResult,
6
- Prompt,
7
- PromptMessage,
8
- Resource,
9
- ResourceTemplate,
10
- } from '@modelcontextprotocol/sdk/types.js';
11
-
12
- export type MCPServerResourceContentCallback = ({
13
- uri,
14
- }: {
15
- uri: string;
16
- }) => Promise<MCPServerResourceContent | MCPServerResourceContent[]>;
17
- export type MCPServerResourceContent = { text?: string } | { blob?: string };
18
- export type MCPServerResources = {
19
- listResources: () => Promise<Resource[]>;
20
- getResourceContent: MCPServerResourceContentCallback;
21
- resourceTemplates?: () => Promise<ResourceTemplate[]>;
22
- };
23
-
24
- export type MCPServerPromptMessagesCallback = ({
25
- name,
26
- version,
27
- args,
28
- }: {
29
- name: string;
30
- version?: string;
31
- args?: any;
32
- }) => Promise<PromptMessage[]>;
33
-
34
- export type MCPServerPrompts = {
35
- listPrompts: () => Promise<Prompt[]>;
36
- getPromptMessages?: MCPServerPromptMessagesCallback;
37
- };
38
-
39
- export type ElicitationActions = {
40
- sendRequest: (request: ElicitRequest['params']) => Promise<ElicitResult>;
41
- };
42
-
43
- export type MCPRequestHandlerExtra = RequestHandlerExtra<any, any>;
44
-
45
- export type MCPTool = {
46
- id?: InternalCoreTool['id'];
47
- description?: InternalCoreTool['description'];
48
- parameters: InternalCoreTool['parameters'];
49
- outputSchema?: InternalCoreTool['outputSchema'];
50
- execute: (
51
- params: any,
52
- options: Parameters<NonNullable<InternalCoreTool['execute']>>[1] & {
53
- elicitation: ElicitationActions;
54
- extra: MCPRequestHandlerExtra;
55
- },
56
- ) => Promise<any>;
57
- };
58
-
59
- export type { Resource, ResourceTemplate };
@@ -1,9 +0,0 @@
1
- {
2
- "extends": ["./tsconfig.json", "../../tsconfig.build.json"],
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src"
6
- },
7
- "include": ["src/**/*"],
8
- "exclude": ["node_modules", "**/*.test.ts", "src/**/*.mock.ts"]
9
- }
package/tsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.node.json",
3
- "include": ["src/**/*", "tsup.config.ts"],
4
- "exclude": ["node_modules", "**/*.test.ts"]
5
- }
package/tsup.config.ts DELETED
@@ -1,17 +0,0 @@
1
- import { generateTypes } from '@internal/types-builder';
2
- import { defineConfig } from 'tsup';
3
-
4
- export default defineConfig({
5
- entry: ['src/index.ts'],
6
- format: ['esm', 'cjs'],
7
- clean: true,
8
- dts: false,
9
- splitting: true,
10
- treeshake: {
11
- preset: 'smallest',
12
- },
13
- sourcemap: true,
14
- onSuccess: async () => {
15
- await generateTypes(process.cwd());
16
- },
17
- });
package/vitest.config.ts DELETED
@@ -1,8 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- globals: true,
6
- include: ['src/**/*.test.ts'],
7
- },
8
- });