You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@smithery/sdk

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithery/sdk

SDK to develop with Smithery

Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
5K
-19.07%
Maintainers
1
Weekly downloads
 
Created
Source

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:

  • Creates a stateless server that handles MCP requests
  • Defines a function to create MCP server instances for each session
  • 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.

FAQs

Package last updated on 05 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts