About sdk-client-ssejs
sdk-client-ssejs is an MCP server published by git+mybigday in the Developer Tools category: client transport alternative of @modelcontextprotocol/sdk/client base on sse.js. The main purpose is make it working on React Native with llama.rn.
Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
npx mcp-sdk-client-ssejsclaude mcp add sdk-client-ssejs -- npx -y mcp-sdk-client-ssejsnpx -y mcp-sdk-client-ssejsThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about sdk-client-ssejs
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
4 checks have not been run yet.
README
MCP SDK Client SSE.js
Client transport alternative of @modelcontextprotocol/sdk/client base on sse.js. The main purpose is make it working on React Native with llama.rn.
Supports:
- Streamable HTTP
- SSE
Installation
npm install @modelcontextprotocol/sdk
npm install mcp-sdk-client-ssejs
- For use
@modelcontextprotocol/sdkin React Native, you may need enableunstable_enablePackageExports: truein the project's metro config. - Or you can try to use
babel-plugin-module-resolverto alias the@modelcontextprotocol/sdkto@modelcontextprotocol/sdk/dist/esmin babel config:
module.exports = {
presets: [/* ... */],
plugins: [
// ...
[
'module-resolver',
{
alias: {
'@modelcontextprotocol/sdk': '@modelcontextprotocol/sdk/dist/esm',
},
},
],
],
}
If CustomEvent is missing in the React Native environment, you may need to add a polyfill for it, you can try our approach:
import NativeCustomEvent from 'react-native/Libraries/Events/CustomEvent'
window.CustomEvent = class CustomEvent extends NativeCustomEvent {
constructor(type, eventInitDict = {}) {
super(type, eventInitDict)
}
}
Usage
The usage is the most same as the original @modelcontextprotocol/sdk/client, but you need to use SSEJSStreamableHTTPClientTransport or SSEJSClientTransport instead of StreamableHTTPClientTransport or SSEClientTransport. (There are no STDIO support in this package.)
SSEJSStreamableHTTPClientTransport
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { SSEJSStreamableHTTPClientTransport } from 'mcp-sdk-client-ssejs'
const transport = new SSEJSStreamableHTTPClientTransport(
'http://<your-mcp-server-sse-endpoint-url>',
{ /* TransportOptions */ },
)
const client = new Client({
name: 'example-client',
version: '1.0.0',
})
await client.connect(transport)
// List prompts
const prompts = await client.listPrompts()
// Get a prompt
const prompt = await client.getPrompt({
name: 'example-prompt',
arguments: {
arg1: 'value',
},
})
// List resources
const resources = await client.listResources()
// Read a resource
const resource = await client.readResource({
uri: 'file:///example.txt',
})
// Call a tool
const result = await client.callTool({
name: 'example-tool',
arguments: {
arg1: 'value',
},
})
SSEJSClientTransport
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { SSEJSClientTransport } from 'mcp-sdk-client-ssejs'
const transport = new SSEJSClientTransport(
'http://<your-mcp-server-sse-endpoint-url>',
{ /* TransportOptions */ },
)
const client = new Client({
name: 'example-client',
version: '1.0.0',
})
await client.connect(transport)
// Usage is the same as with SSEJSStreamableHTTPClientTransport
Use fetch / URL as optional parameters
Both transport options accept URL and fetch options.
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { SSEJSStreamableHTTPClientTransport, SSEJSClientTransport } from 'mcp-sdk-client-ssejs'
// Example: Use whatwg-url-without-unicode
import { URL } from 'whatwg-url-without-unicode'
// For SSEJSStreamableHTTPClientTransport
const streamableTransport = new SSEJSStreamableHTTPClientTransport(
'http://<your-mcp-server-sse-endpoint-url>'
{
URL,
// Example: Custom fetch implementation
fetch: (...args) => fetch(...args),
},
)
// Or for SSEJSClientTransport
const transport = new SSEJSClientTransport(
'http://<your-mcp-server-sse-endpoint-url>',
{
URL,
fetch: (...args) => fetch(...args),
},
)
Use cases
- BRICKS - Our product for building interactive signage in simple way. We provide AI functions as Generator LLM/Assistant/MCP/MCPServer.
- The Generator MCP (Client) is based on this package.
- llama.rn/example - llama.rn example app
- Please see
Tool Calling & MCPexample.
- Please see
License
MIT
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.