dynamicedge API
  • Welcome Dynamic EDGE
  • DYNAMIC PRODUCT SUITE
    • Dynamic Protocol Mcp
    • MCP Protocol: STDIO vs SSE
    • Developer Toolkit Suite
    • DEVELOPER GUIDE
    • use-case
    • Web3 Integration Guide
    • ecosystem
    • ROADMAP
Powered by GitBook
On this page
Export as PDF
  1. DYNAMIC PRODUCT SUITE

MCP Protocol: STDIO vs SSE

The MCP protocol supports two distinct communication modes between MCP Servers and Clients:

STDIO (Standard Input/Output)

  • "Face-to-face conversation" model

  • Client and server communicate directly through local process stdin/stdout

  • Example: During local development, your script launches via command line and exchanges data directly with MCP server without network

  • Configuration example (local MongoDB integration):

Feel free to test it out and copy the Markdown below by hovering over the code block in the upper right, and pasting into a new line underneath.

SSE (Server-Sent Events)

  • "Hotline call" model

  • Client connects to remote server via HTTP, enabling server push

  • Example: AI assistant calling weather API with continuous updates

  • Configuration example:

# {
  "mcpServers": {
    "browser-use-mcp-server": {
      "url": "http://localhost:8000/sse"
    }
  }
{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "~/Downloads"
      ]
    }
  }
}

Python Code Example (SSE Client)

import asyncio
from mcp.client.sse import sse_client
from mcp import ClientSession

async def main():
    async with sse_client("https://deepcore.top/mcp/assistant/0bb0d57e-492e-4461cbb40da?api-key=tk_e5d65e604b9a6") as streams:
        async with ClientSession(*streams) as session:
            await session.initialize()
            
            # List available tools
            print(await session.list_tools())
            
            # Call specific tool
            response = await session.call_tool('Dexranking', {'message': 'hello world'})
            print(response)

if __name__ == '__main__':
    asyncio.run(main())
PreviousDynamic Protocol McpNextDeveloper Toolkit Suite

Last updated 13 days ago