- As an MCP server you can give to your agent
- As a standard REST API endpoint that you can invoke directly from your workflow
- Typescript / Vercel AI SDK
- Python / Langchain
- Typescript / Vercel AI SDK
- Python / Langchain
🚀 We are preparing our documentation and source code for our first release. For any questions & to meet the founders, please fill in this form
Introduction to secure MCP functions
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse';
const mcpClient = await createMCPClient({
transport: {
type: 'http',
// this is automatically injected by the Soma API server
url: process.env.SOMA_BRIDGE_MCP_URL,
headers: {
// this is automatically injected by the Soma API server
'X-Api-Key': process.env.SOMA_AGENT_API_KEY,
// this is automatically injected by the Soma API server
'Authorization': `Bearer ${process.env.SOMA_USER_ACCESS_TOKEN}`,
},
}
})
const tools = await mcpClient.tools();
const response = await generateText({
model: 'openai/gpt-4o',
tools,
stopWhen: stepCountIs(5),
messages: [
{
role: 'user',
content: [{ type: 'text', text: 'Find products under $100' }],
},
],
});
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_openai_tools_agent
import os
client = MultiServerMCPClient(
{
"soma": {
"transport": "http",
# this is automatically injected by the Soma API server
"url": os.getenv("SOMA_BRIDGE_MCP_URL"),
"headers": {
# this is automatically injected by the Soma API server
"X-Api-Key": os.getenv("SOMA_AGENT_API_KEY"),
# this is automatically injected by the Soma API server
"Authorization": `Bearer ${os.getenv("SOMA_USER_ACCESS_TOKEN")}`,
},
}
}
)
tools = await client.get_tools()
agent = create_agent(
"claude-sonnet-4-5-20250929",
tools
)
import { type BridgeDefinition, getBridge } from "../soma/bridge";
// No need to pass in any credentials, they are automatically injected by the Soma API server
const bridge = getBridge(ctx);
const res = await bridge.gmailUser.sendEmail({
to: "[email protected]",
subject: "Test email",
body: "This is a test email",
});
from soma.bridge import Bridge, get_bridge
# Get bridge instance
# No need to pass in any credentials, they are automatically injected by the Soma API server
bridge = get_bridge(params.ctx)
await bridge.gmail_user.send_email(
to="[email protected]",
subject="Test email",
body="This is a test email",
)