From 9a3d9f15c1e51f2c11c7cc4846a387cfa35b4631 Mon Sep 17 00:00:00 2001 From: Trailgenic Date: Tue, 14 Jul 2026 00:00:13 +0000 Subject: [PATCH] Advertise latest stable MCP protocol --- lib/ella-registry.ts | 4 ++-- tests/mcp.test.ts | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lib/ella-registry.ts b/lib/ella-registry.ts index 6042eba..a431ee9 100644 --- a/lib/ella-registry.ts +++ b/lib/ella-registry.ts @@ -9,8 +9,8 @@ import { } from './entity-data' export const ELLA_CANONICAL_ENTITY_ID = 'https://ellaentity.ai/#ella' as const -export const ELLA_MCP_SERVER_INFO = { name: 'ellaentity-mcp', version: '1.1.1' } as const -export const ELLA_MCP_PROTOCOL_VERSIONS = ['2025-06-18'] as const +export const ELLA_MCP_SERVER_INFO = { name: 'ellaentity-mcp', version: '1.1.2' } as const +export const ELLA_MCP_PROTOCOL_VERSIONS = ['2025-11-25', '2025-06-18'] as const export const ELLA_MCP_DEFAULT_PROTOCOL_VERSION = ELLA_MCP_PROTOCOL_VERSIONS[0] export const ELLA_REGISTRY_DATA_VERSION = '2026-07-13.mcp-v1-1' as const export const ELLA_REGISTRY_LAST_MODIFIED = '2026-07-13' as const diff --git a/tests/mcp.test.ts b/tests/mcp.test.ts index 4e7c652..b8f6f34 100644 --- a/tests/mcp.test.ts +++ b/tests/mcp.test.ts @@ -3,14 +3,14 @@ import test from 'node:test' import Ajv from 'ajv' import addFormats from 'ajv-formats' import { GET, OPTIONS, POST } from '../app/mcp/route' -import { ELLA_MCP_RESOURCES, ELLA_MCP_TOOL_NAMES } from '../lib/ella-registry' +import { ELLA_MCP_PROTOCOL_VERSIONS, ELLA_MCP_RESOURCES, ELLA_MCP_TOOL_NAMES } from '../lib/ella-registry' const endpoint = 'https://ellaentity.ai/mcp' const accept = 'application/json, text/event-stream' const contentType = 'application/json' -const protocolVersion = '2025-06-18' +const defaultProtocolVersion = ELLA_MCP_PROTOCOL_VERSIONS[0] -function request(method: string, body?: unknown, headers: HeadersInit = {}) { +function request(method: string, body?: unknown, headers: HeadersInit = {}, protocolVersion: (typeof ELLA_MCP_PROTOCOL_VERSIONS)[number] = defaultProtocolVersion) { return new Request(endpoint, { method, headers: { @@ -23,7 +23,7 @@ function request(method: string, body?: unknown, headers: HeadersInit = {}) { }) } -async function rpc(method: string, params: unknown = {}, id: string | number = 1, headers: HeadersInit = {}) { +async function rpc(method: string, params: unknown = {}, id: string | number = 1, headers: HeadersInit = {}, protocolVersion: (typeof ELLA_MCP_PROTOCOL_VERSIONS)[number] = defaultProtocolVersion) { const response = await POST( request( 'POST', @@ -34,6 +34,7 @@ async function rpc(method: string, params: unknown = {}, id: string | number = 1 params, }, headers, + protocolVersion, ), ) const text = await response.text() @@ -72,23 +73,31 @@ test('POST validates content negotiation and origins', async () => { }) test('initialize validates official params and reports server capabilities', async () => { - const valid = await rpc('initialize', { - protocolVersion, - capabilities: {}, - clientInfo: { name: 'behavior-test-client', version: '1.0.0' }, - }) - - assert.equal(valid.response.status, 200) - assert.equal(valid.body.result.serverInfo.name, 'ellaentity-mcp') - assert.equal(valid.body.result.protocolVersion, protocolVersion) - assert.ok(valid.body.result.capabilities.tools) - assert.ok(valid.body.result.capabilities.resources) + for (const protocolVersion of ELLA_MCP_PROTOCOL_VERSIONS) { + const valid = await rpc( + 'initialize', + { + protocolVersion, + capabilities: {}, + clientInfo: { name: 'behavior-test-client', version: '1.0.0' }, + }, + 1, + {}, + protocolVersion, + ) + + assert.equal(valid.response.status, 200) + assert.equal(valid.body.result.serverInfo.name, 'ellaentity-mcp') + assert.equal(valid.body.result.protocolVersion, protocolVersion) + assert.ok(valid.body.result.capabilities.tools) + assert.ok(valid.body.result.capabilities.resources) + } const missingProtocol = await rpc('initialize', { capabilities: {}, clientInfo: { name: 'behavior-test-client', version: '1.0.0' }, }) - assert.ok(missingProtocol.body.error || missingProtocol.body.result.protocolVersion === protocolVersion) + assert.ok(missingProtocol.body.error || missingProtocol.body.result.protocolVersion === defaultProtocolVersion) const invalidId = await POST(request('POST', { jsonrpc: '2.0', id: null, method: 'ping', params: {} })) assert.notEqual(invalidId.status, 200) @@ -108,7 +117,7 @@ test('notifications return no JSON-RPC body', async () => { }) test('tools list and calls are behavioral and schema-valid', async () => { - const list = await rpc('tools/list') + const list = await rpc('tools/list', {}, 1, { 'mcp-protocol-version': '2025-11-25' }, '2025-11-25') const tools = list.body.result.tools assert.deepEqual(tools.map((tool: { name: string }) => tool.name), ELLA_MCP_TOOL_NAMES)