Model context protocol (MCP)
curl --request POST \
--url http://localhost:7700/mcp \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "<string>",
"id": 123,
"method": "<string>",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "<string>",
"io.modelcontextprotocol/clientInfo": "<unknown>",
"io.modelcontextprotocol/clientCapabilities": "<unknown>"
},
"name": "<string>",
"arguments": "<unknown>"
}
}
'import requests
url = "http://localhost:7700/mcp"
payload = {
"jsonrpc": "<string>",
"id": 123,
"method": "<string>",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "<string>",
"io.modelcontextprotocol/clientInfo": "<unknown>",
"io.modelcontextprotocol/clientCapabilities": "<unknown>"
},
"name": "<string>",
"arguments": "<unknown>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '<string>',
id: 123,
method: '<string>',
params: {
_meta: {
'io.modelcontextprotocol/protocolVersion': '<string>',
'io.modelcontextprotocol/clientInfo': '<unknown>',
'io.modelcontextprotocol/clientCapabilities': '<unknown>'
},
name: '<string>',
arguments: '<unknown>'
}
})
};
fetch('http://localhost:7700/mcp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7700",
CURLOPT_URL => "http://localhost:7700/mcp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '<string>',
'id' => 123,
'method' => '<string>',
'params' => [
'_meta' => [
'io.modelcontextprotocol/protocolVersion' => '<string>',
'io.modelcontextprotocol/clientInfo' => '<unknown>',
'io.modelcontextprotocol/clientCapabilities' => '<unknown>'
],
'name' => '<string>',
'arguments' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:7700/mcp"
payload := strings.NewReader("{\n \"jsonrpc\": \"<string>\",\n \"id\": 123,\n \"method\": \"<string>\",\n \"params\": {\n \"_meta\": {\n \"io.modelcontextprotocol/protocolVersion\": \"<string>\",\n \"io.modelcontextprotocol/clientInfo\": \"<unknown>\",\n \"io.modelcontextprotocol/clientCapabilities\": \"<unknown>\"\n },\n \"name\": \"<string>\",\n \"arguments\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:7700/mcp")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"<string>\",\n \"id\": 123,\n \"method\": \"<string>\",\n \"params\": {\n \"_meta\": {\n \"io.modelcontextprotocol/protocolVersion\": \"<string>\",\n \"io.modelcontextprotocol/clientInfo\": \"<unknown>\",\n \"io.modelcontextprotocol/clientCapabilities\": \"<unknown>\"\n },\n \"name\": \"<string>\",\n \"arguments\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7700/mcp")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"<string>\",\n \"id\": 123,\n \"method\": \"<string>\",\n \"params\": {\n \"_meta\": {\n \"io.modelcontextprotocol/protocolVersion\": \"<string>\",\n \"io.modelcontextprotocol/clientInfo\": \"<unknown>\",\n \"io.modelcontextprotocol/clientCapabilities\": \"<unknown>\"\n },\n \"name\": \"<string>\",\n \"arguments\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 42,
"result": {
"resultType": "complete",
"supportedVersions": [
"2026-07-28"
],
"capabilities": {
"tools": {}
},
"_meta": {
"io.modelcontextprotocol/serverInfo": {
"name": "Meilisearch",
"version": "1.52.0"
}
},
"instructions": "This is a Meilisearch instance that is capable of returning documents based on a search query.",
"ttlMs": 3600000,
"cacheScope": "public"
}
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}MCP
Model context protocol (MCP)
The /mcp route exposes the MCP open protocol that enables seamless integration between LLM
applications and external data sources and tools.
POST
/
mcp
Model context protocol (MCP)
curl --request POST \
--url http://localhost:7700/mcp \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "<string>",
"id": 123,
"method": "<string>",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "<string>",
"io.modelcontextprotocol/clientInfo": "<unknown>",
"io.modelcontextprotocol/clientCapabilities": "<unknown>"
},
"name": "<string>",
"arguments": "<unknown>"
}
}
'import requests
url = "http://localhost:7700/mcp"
payload = {
"jsonrpc": "<string>",
"id": 123,
"method": "<string>",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "<string>",
"io.modelcontextprotocol/clientInfo": "<unknown>",
"io.modelcontextprotocol/clientCapabilities": "<unknown>"
},
"name": "<string>",
"arguments": "<unknown>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '<string>',
id: 123,
method: '<string>',
params: {
_meta: {
'io.modelcontextprotocol/protocolVersion': '<string>',
'io.modelcontextprotocol/clientInfo': '<unknown>',
'io.modelcontextprotocol/clientCapabilities': '<unknown>'
},
name: '<string>',
arguments: '<unknown>'
}
})
};
fetch('http://localhost:7700/mcp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7700",
CURLOPT_URL => "http://localhost:7700/mcp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '<string>',
'id' => 123,
'method' => '<string>',
'params' => [
'_meta' => [
'io.modelcontextprotocol/protocolVersion' => '<string>',
'io.modelcontextprotocol/clientInfo' => '<unknown>',
'io.modelcontextprotocol/clientCapabilities' => '<unknown>'
],
'name' => '<string>',
'arguments' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:7700/mcp"
payload := strings.NewReader("{\n \"jsonrpc\": \"<string>\",\n \"id\": 123,\n \"method\": \"<string>\",\n \"params\": {\n \"_meta\": {\n \"io.modelcontextprotocol/protocolVersion\": \"<string>\",\n \"io.modelcontextprotocol/clientInfo\": \"<unknown>\",\n \"io.modelcontextprotocol/clientCapabilities\": \"<unknown>\"\n },\n \"name\": \"<string>\",\n \"arguments\": \"<unknown>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:7700/mcp")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"<string>\",\n \"id\": 123,\n \"method\": \"<string>\",\n \"params\": {\n \"_meta\": {\n \"io.modelcontextprotocol/protocolVersion\": \"<string>\",\n \"io.modelcontextprotocol/clientInfo\": \"<unknown>\",\n \"io.modelcontextprotocol/clientCapabilities\": \"<unknown>\"\n },\n \"name\": \"<string>\",\n \"arguments\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7700/mcp")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"<string>\",\n \"id\": 123,\n \"method\": \"<string>\",\n \"params\": {\n \"_meta\": {\n \"io.modelcontextprotocol/protocolVersion\": \"<string>\",\n \"io.modelcontextprotocol/clientInfo\": \"<unknown>\",\n \"io.modelcontextprotocol/clientCapabilities\": \"<unknown>\"\n },\n \"name\": \"<string>\",\n \"arguments\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 42,
"result": {
"resultType": "complete",
"supportedVersions": [
"2026-07-28"
],
"capabilities": {
"tools": {}
},
"_meta": {
"io.modelcontextprotocol/serverInfo": {
"name": "Meilisearch",
"version": "1.52.0"
}
},
"instructions": "This is a Meilisearch instance that is capable of returning documents based on a search query.",
"ttlMs": 3600000,
"cacheScope": "public"
}
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}Body
application/json
Defines the version of a JSON-RPC request.
You can find more information about this field on the JSON-RPC specification.
Defines the id of a JSON-RPC request.
You can find more information about this field on the JSON-RPC specification.
The method to call using the JSON-RPC format.
You can find more information about this field on the JSON-RPC specification.
The parameters to call the method with following the JSON-RPC format.
You can find more information about this field on the JSON-RPC specification.
Show child attributes
Show child attributes
Was this page helpful?