Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Hono runs on Node through `@hono/node-server`; the official `@modelcontextprotoc

## MCP compatibility

The tool retains the legacy server's `answer_islamic_question` name, detailed description and input help, and `readOnlyHint: true` / `openWorldHint: true` annotations. It accepts 1–4,000 characters, matching the Ansari API. The earlier experimental RC exposed `ask_ansari`; a deployment owner must refresh host discovery when adopting this tool name. The endpoint remains `/mcp`. Replacing the existing `mcp.ansari.chat` service and changing its DNS are separate rollout actions.
The tool retains the legacy server's `answer_islamic_question` name, detailed description and input help, and `readOnlyHint: true` / `openWorldHint: true` annotations, plus an explicit `destructiveHint: false`, which OpenAI's app directory requires (#442). It accepts 1–4,000 characters, matching the Ansari API. The earlier experimental RC exposed `ask_ansari`; a deployment owner must refresh host discovery when adopting this tool name. The endpoint remains `/mcp`. Replacing the existing `mcp.ansari.chat` service and changing its DNS are separate rollout actions.

### "Unable to reach" after a deploy

Expand Down
2 changes: 1 addition & 1 deletion apps/mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ansari-mcp",
"version": "0.17.2",
"version": "0.17.3",
"private": true,
"type": "module",
"description": "Ansari's MCP application",
Expand Down
4 changes: 2 additions & 2 deletions apps/mcp/src/server/create-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function createAnsariMcpServer(options:CreateMcpServerOptions):McpServer{
name:'answer_islamic_question',
title:'Answer Islamic Question',
description:'Answers questions about Islam including theology, jurisprudence (fiqh), history, Quranic interpretation (tafsir), Hadith sciences, Islamic law, worship practices, ethics, spirituality, and contemporary issues. Provides comprehensive answers with citations from Quran, authentic Hadith, and classical Islamic scholarship. Can handle questions about specific verses, hadiths, scholarly opinions, historical events, prophets, companions, and modern applications of Islamic principles.',
// Preserve the legacy discovery contract; read-only tools need no destructive/idempotent hints.
annotations:{readOnlyHint:true,openWorldHint:true},
// The legacy discovery hints, plus an explicit destructiveHint, which OpenAI's directory review requires (#442).
annotations:{readOnlyHint:true,destructiveHint:false,openWorldHint:true},
// Application handler bound, with a fresh lifetime per call.
boundMs:HANDLER_BOUND_MS,
input:z.object({question:z.string().min(1).max(4000).describe('The question about Islam to be answered. Include as much context and detail as possible. You can ask about specific Quranic verses, hadiths, Islamic rulings, historical events, theological concepts, or practical applications. The more context provided, the more comprehensive and relevant the answer will be.')}),
Expand Down
2 changes: 1 addition & 1 deletion apps/mcp/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// One application identity, shared by the server and built view.
export const APP_VERSION = '0.17.2';
export const APP_VERSION = '0.17.3';
2 changes: 1 addition & 1 deletion apps/mcp/test/parity-cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function defineParityCases(kind: RuntimeKind): void {
assert.deepEqual(tools.map(tool => tool.name), ['answer_islamic_question']);
assert.equal(tools[0].annotations?.readOnlyHint, true);
assert.equal(tools[0].annotations?.openWorldHint, true);
assert.equal(tools[0].annotations?.destructiveHint, undefined);
assert.equal(tools[0].annotations?.destructiveHint, false);
assert.equal(tools[0].annotations?.idempotentHint, undefined);
const before = upstream.seen.length;
const question = `complete ${kind} ${mode}`;
Expand Down
2 changes: 1 addition & 1 deletion apps/mcp/test/request-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test('legacy discovery and question bounds are enforced before upstream work', a
assert.equal(tools[0].description, legacyDescription);
assert.equal(tools[0].annotations?.readOnlyHint, true);
assert.equal(tools[0].annotations?.openWorldHint, true);
assert.equal(tools[0].annotations?.destructiveHint, undefined);
assert.equal(tools[0].annotations?.destructiveHint, false);
assert.equal(tools[0].annotations?.idempotentHint, undefined);
for (const question of ['', 'x'.repeat(4001)]) {
const result = await client.callTool({name: toolName, arguments: {question}}).then(
Expand Down
Loading