1.5.2 • Published 29 days ago

@smithery/sdk v1.5.2

Weekly downloads
-
License
MIT
Repository
-
Last release
29 days ago

Smithery Typescript SDK

The SDK provides files for you to easily setup Smithery-compatible MCP servers and clients.

Installation

npm install @smithery/sdk @modelcontextprotocol/sdk

Usage

Spawning a Server

Here's a minimal example of how to use the SDK to spawn an MCP server.

import { createStatelessServer } from '@smithery/sdk/server/stateless.js'
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"

// Create your MCP server function
function createMcpServer({ config }) {
  // Create and return a server instance
  // https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#core-concepts
  const mcpServer = new McpServer({
    name: "My App",
    version: "1.0.0"
  })

  // ...
  
  return mcpServer.server
}

// Create the stateless server using your MCP server function.
createStatelessServer(createMcpServer)
  .app
  .listen(process.env.PORT || 3000)

This example: 1. Creates a stateless server that handles MCP requests 2. Defines a function to create MCP server instances for each session 3. Starts the Express server on the specified port. You must listen on the PORT env var if provided for the deployment to work on Smithery.

Stateful Server

Most API integrations are stateless.

However, if your MCP server needs to persist state between calls (i.e., remembering previous interactions in a single chat conversation), you can use the createStatefulServer function instead.

1.5.2

29 days ago

1.5.1

29 days ago

1.4.3

1 month ago

1.4.2

1 month ago

1.4.1

1 month ago

1.3.4

1 month ago

1.3.3

2 months ago

1.3.2

2 months ago

1.3.1

2 months ago

1.2.3

2 months ago

1.2.2

2 months ago

1.2.1

2 months ago

1.1.2

2 months ago

1.1.1

2 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.2

4 months ago

1.0.1

4 months ago

0.0.25

5 months ago

0.0.24

5 months ago

0.0.23

5 months ago

0.0.22

6 months ago

0.0.21

6 months ago

0.0.20

6 months ago

0.0.19

6 months ago

0.0.18

6 months ago

0.0.17

6 months ago

0.0.16

6 months ago

0.0.15

7 months ago

0.0.14

7 months ago

0.0.13

7 months ago

0.0.12

7 months ago

0.0.11

7 months ago

0.0.10

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.4

7 months ago