MCP-JSON-RPC-Endpunkt aufrufen
Haupt-MCP-JSON-RPC-Endpunkt.
Unterstützt:
- Einzelne JSON-RPC-Request-Objekte
- JSON-RPC-Batch-Request-Arrays
- Server-Sent Events, wenn
Accept: text/event-streamgesendet wird
Authentifizierungsregeln:
- Keine Authentifizierung erforderlich für
initialize,tools/listundping - Authentifizierung erforderlich für
tools/call - Bearer-Tokens können API-Schlüssel mit dem Präfix
nf_oder OAuth-Access-Tokens mit dem Präfixmcp_at_sein
curl -X POST "https://api.example.com/mcp-server/" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (API key or OAuth access token)" \
-d '{
"jsonrpc": "2.0",
"id": "req_1",
"method": "tools/list",
"params": {}
}'
import requests
import json
url = "https://api.example.com/mcp-server/"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (API key or OAuth access token)"
}
data = {
"jsonrpc": "2.0",
"id": "req_1",
"method": "tools/list",
"params": {}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.example.com/mcp-server/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (API key or OAuth access token)"
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": "req_1",
"method": "tools/list",
"params": {}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"jsonrpc": "2.0",
"id": "req_1",
"method": "tools/list",
"params": {}
}`)
req, err := http.NewRequest("POST", "https://api.example.com/mcp-server/", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (API key or OAuth access token)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/mcp-server/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (API key or OAuth access token)'
request.body = '{
"jsonrpc": "2.0",
"id": "req_1",
"method": "tools/list",
"params": {}
}'
response = http.request(request)
puts response.body
{
"jsonrpc": "2.0",
"id": "req_1",
"result": {
"content": [
{
"type": "text",
"text": "Tool completed successfully."
}
],
"structuredContent": {
"filingId": "filing_123",
"status": "completed"
}
}
}
{
"jsonrpc": "2.0",
"id": "req_1",
"result": {
"isError": true,
"content": [
{
"type": "text",
"text": "Missing required filing identifier."
}
]
}
}
{}
{
"jsonrpc": "2.0",
"id": null,
"error": {
"code": -32700,
"message": "Parse error"
}
}
{
"jsonrpc": "2.0",
"id": "req_1",
"error": {
"code": -32001,
"message": "Unauthorized"
}
}
{
"jsonrpc": "2.0",
"id": "req_1",
"error": {
"code": -32601,
"message": "Method not found"
}
}
POST
/
POST
Base URLstring
Target server for requests. Edit to use your own host.
Bearer Token (API key or OAuth access token)
Bearer Tokenstring
RequiredBearer-Authentifizierung mit Nomadfiling-API-Schlüsseln mit dem Präfix nf_ oder OAuth-Access-Tokens mit dem Präfix mcp_at_.
Bearer-Authentifizierung mit Nomadfiling-API-Schlüsseln mit dem Präfix
nf_ oder OAuth-Access-Tokens mit dem Präfix mcp_at_.Content-Typestring
RequiredThe media type of the request body
Options: application/json
No request body parameters defined
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBearer token (API key or OAuth access token). Bearer-Authentifizierung mit Nomadfiling-API-Schlüsseln mit dem Präfix nf_ oder OAuth-Access-Tokens mit dem Präfix mcp_at_.
Body
application/json
datastring
RequiredRaw application/json data
Responses
jsonrpcstring
RequiredAllowed values:
2.0idstring
RequiredRequest-Kennung, übernommen aus der Anfrage.
resultobject
RequiredWas this page helpful?