OpenAI Connector
OpenAI API connector for model discovery, chat completions, and embeddings.
Credential setup
bearerCreate a dedicated API key with spend limits; chat and embedding calls require approval.
Setup docs: https://platform.openai.com/api-keys
After adding this connector, attach the credential on the server page, then run astrail tools list.
Hosted MCP endpoint
/api/mcp/preset-openaiPrivate servers require an Astrail API key in the Authorization header.
MCP client snippets
ConnectClaude Desktop config
{
"mcpServers": {
"openai-connector": {
"url": "/api/mcp/preset-openai"
}
}
}cURL initialize
curl -sS -X POST "/api/mcp/preset-openai" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'cURL tools/list
curl -sS -X POST "/api/mcp/preset-openai" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'cURL tools/call
curl -sS -X POST "/api/mcp/preset-openai" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"openai_list_models","arguments":{}}}'Runtime behavior
healthynot_checkedsafe_rest_executionnot recordednot recordednot recordednonestructured fallbackstandardauth_required / oauth_requiredmapping_requiredAstrail does not evaluate generated TypeScript inside Next.js. Hosted calls are routed through stored tool metadata and endpoint maps.
Tools
4openai_list_modelsList models available from the OpenAI API.
openai_retrieve_modelRetrieve an OpenAI model by id.
openai_create_chat_completionCreate an OpenAI chat completion after approval because this incurs provider usage.
openai_create_embeddingCreate OpenAI embeddings after approval because this incurs provider usage.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "OpenAI Connector", version: "1.0.0" });
// Curated Astrail connector for: openai_list_models, openai_retrieve_model, openai_create_chat_completion, openai_create_embedding.
// The hosted endpoint executes its verified deterministic endpoint map. Attach a least-privilege provider credential before calling private tools.
server.tool("connector_status", "Confirm this curated connector template is installed.", z.object({}), async () => ({
content: [{ type: "text", text: "Connector installed. Attach provider credentials to enable hosted API calls." }],
}));
const transport = new StdioServerTransport();
await server.connect(transport);