Tratopedia
繁中
Settings

Text size

Language

Theme

High contrast

Version

v1.230.2

The release this page was built from. It is what the service worker caches under.

Slide deck

Back

REST, SOAP, gRPC, GraphQL and MCP: pick by who calls

Pick an API style by who calls it: REST for outside developers, gRPC between your own services, GraphQL for front ends with many screens, SOAP only for old links. MCP is another kind: it wraps the other four as tools for AI agents, and is stateless since July 2026.

  1. API guide · 27 October 2026

    Five ways software talks to software

    REST, SOAP, gRPC, GraphQL and MCP, explained for beginners and professionals.

    REST · SOAP · gRPC · GraphQL · MCP1 / 15

  2. The basics

    What is an API?

    An API is an agreed way for one program to ask another for something and get a predictable answer. Think of ordering in a restaurant.

    You

    The client: an app, a website or an AI agent that wants something.

    The waiter

    The API: the menu and the rules for ordering.

    The kitchen

    The server: the system that holds the data and does the work.

    REST · SOAP · gRPC · GraphQL · MCP2 / 15

  3. The basics

    The five at a glance

    NameWhat it isThink of it as
    RESTWeb addresses plus standard actionsA library catalogue
    SOAPFormal XML messages with strict contractsA registered letter
    gRPCFast binary calls between servicesA direct line between colleagues
    GraphQLOne endpoint; you ask for exactly the fields you needA custom order form
    MCPA standard plug for AI agents to use tools and dataA universal adapter

    REST · SOAP · gRPC · GraphQL · MCP3 / 15

  4. The five · 1 of 5

    REST: resources at web addresses

    Best for: public web APIs, websites and mobile apps.

    StepExample
    RequestGET /orders/42
    Response200 OK, with the order as JSON
    • Everything is a resource with its own address, such as an order, a user or a photo.
    • Standard verbs: GET reads, POST creates, PUT or PATCH updates, DELETE removes.
    • Cache-friendly: browsers and CDNs can store GET results.

    REST · SOAP · gRPC · GraphQL · MCP4 / 15

  5. The five · 2 of 5

    SOAP: the formal envelope

    Best for: connecting existing bank, insurance and government systems. Avoid it for new APIs.

    PartHolds
    Envelope (XML)The whole message
    HeaderSecurity, routing and extras
    BodyThe actual request or reply
    • Strict contract: a WSDL file and XML schemas describe every message.
    • Message-level security: WS-Security can sign and encrypt the message itself.
    • Heavy: XML is verbose, so it is slow and awkward on mobile.

    REST · SOAP · gRPC · GraphQL · MCP5 / 15

  6. The five · 3 of 5

    gRPC: fast calls between services

    Best for: internal microservices, low latency and live streams.

    In a .proto contract
    rpc GetOrder(OrderId) returns (Order);
    • Contract first: one .proto file generates client and server code in many languages.
    • Compact and quick: binary messages over HTTP/2, with four streaming modes.
    • Browser limits: web pages need gRPC-Web or a JSON gateway.

    REST · SOAP · gRPC · GraphQL · MCP6 / 15

  7. The five · 4 of 5

    GraphQL: ask for exactly what you need

    Best for: apps with many screens or clients sharing one data graph.

    One query, one endpoint
    Ask for order(id: 42), and from it only status and each item’s name
    • The client picks the fields, so there is no over-fetching and fewer round trips.
    • Typed schema that tools can explore and check automatically.
    • Extra care: caching needs extra work, and servers need depth and cost limits.

    REST · SOAP · gRPC · GraphQL · MCP7 / 15

  8. The five · 5 of 5

    MCP: a standard plug for AI agents

    Build one MCP server and any compatible AI app can use it, instead of one custom connector per product.

    Tools

    Actions the AI can run, such as creating a ticket.

    Resources

    Data the app can read, such as a file or a record.

    Prompts

    Ready-made templates a person can choose.

    • Runs over stdio (local) or Streamable HTTP (remote), using JSON-RPC 2.0.

    REST · SOAP · gRPC · GraphQL · MCP8 / 15

  9. How they fit together

    MCP sits on top of the others

    MCP does not replace them. It wraps existing APIs as tools, so an AI agent can discover and call them in a standard way. Cloud gateways already turn REST, OpenAPI and GraphQL services into MCP tools.

    LayerWhat it is
    TopAn AI agent or chat app
    MiddleAn MCP server: tools · resources · prompts
    BottomREST · GraphQL · gRPC · SOAP

    REST · SOAP · gRPC · GraphQL · MCP9 / 15

  10. Comparing

    Side by side

    RESTSOAPgRPCGraphQLMCP
    Message formatJSON, mostlyXMLProtobuf (binary)JSONJSON-RPC 2.0
    TransportHTTPMostly HTTPHTTP/2HTTP, usually POSTstdio or Streamable HTTP
    ContractOpenAPIWSDL and XSD.proto fileSchema (SDL)JSON Schema per tool
    StreamingLimitedNoneFour modesSubscriptionsServer events (SSE)
    HTTP cachingBuilt inAlmost noneNoneNeeds extra workCacheable lists since 2026-07-28
    Main callerAny developerEnterprise systemsOther servicesFront-end appsAI agents

    REST · SOAP · gRPC · GraphQL · MCP10 / 15

  11. Comparing

    Speed depends on the workload

    • 77%Lower latency for gRPC than REST on small payloads, 2.3 ms against 10.1 ms
    • 15%Lower latency on large payloads
    • The gap shrinks as messages grow. This is one 2026 benchmark, so test your own workload before choosing a protocol for speed.
    • For MCP, the usual bottleneck is tokens in the AI’s context window, not the wire format.

    REST · SOAP · gRPC · GraphQL · MCP11 / 15

  12. Comparing

    Security: what protects you, what to watch

    MCP’s biggest risks sit in meaning, not transport: treat tool output as untrusted.

    OptionMain protectionCheck for
    RESTTLS, OAuth 2.x, API keysAccess checks on every object, rate limits
    SOAPWS-Security signing and encryptionXML parser hardening
    gRPCTLS or mutual TLS, per-call tokensA deadline on every call
    GraphQLDepth and cost limits, timeoutsCostly queries and batching abuse
    MCPOAuth 2.1, least privilege, approvalsPrompt injection, token passthrough

    REST · SOAP · gRPC · GraphQL · MCP12 / 15

  13. Deciding

    Which one should I use?

    SituationFirst choiceWhy
    Public API for outside developersREST + OpenAPIEasiest to adopt and cache
    Internal service-to-service callsgRPCFast and strongly typed
    An app with many different screensGraphQLFetch only needed fields
    Legacy bank or government linkSOAPWrap it behind REST
    Let an AI agent use your toolsMCPOne plug for many AI apps

    REST · SOAP · gRPC · GraphQL · MCP13 / 15

  14. Deciding

    One company, several styles

    StyleServes
    RESTPartners and third-party developers
    GraphQLYour own web and mobile front ends
    gRPCMicroservices talking to each other
    SOAPLegacy systems, isolated behind an integration layer
    MCPAI agents, through a gateway that handles identity, policy and audit

    REST · SOAP · gRPC · GraphQL · MCP14 / 15

  15. Takeaways

    Three things to remember

    • Pick by who calls you: outside developers, your own services, your own front ends or an AI agent.
    • MCP sits on top of the other four. It does not replace them.
    • Test with your own workload, and secure every layer.

    REST · SOAP · gRPC · GraphQL · MCP15 / 15