
mcp sdk client ssejs
Client transport alternative of @modelcontextprotocol/sdk/client base on sse.js. The main purpose is make it working on React Native with llama.rn.
Repository Info
About This Server
Client transport alternative of @modelcontextprotocol/sdk/client base on sse.js. The main purpose is make it working on React Native with llama.rn.
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
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 mcp-sdk-client-ssejs
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({
url: 'http://<your-mcp-server-sse-endpoint-url>',
})
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({
url: 'http://<your-mcp-server-sse-endpoint-url>',
})
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({
url: 'http://<your-mcp-server-sse-endpoint-url>',
URL,
// Example: Custom fetch implementation
fetch: (...args) => fetch(...args),
})
// Or for SSEJSClientTransport
const transport = new SSEJSClientTransport({
url: '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.
License
MIT
Built and maintained by BRICKS.
Quick Start
Clone the repository
git clone https://github.com/mybigday/mcp-sdk-client-ssejsInstall dependencies
cd mcp-sdk-client-ssejs
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.