Skip to content

Commit 9a69d77

Browse files
Remove proprietary Alpha Theory terms from MCP docs and tests
Clean up references to AT-internal products (rapi-mcp, pyRapi, alpha-knowledge-mcp, alpha-collector-mcp, alpha-gateway-mcp, internal-alpha-theory-mcp, moneyball, hermes_at, atds_research), employee names, internal file paths, and Data API project references from the MCP integration guide and unit test Javadoc/comments. Replace with generic, vendor-neutral language appropriate for an Apache open source project. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f2f7c47 commit 9a69d77

File tree

3 files changed

+77
-171
lines changed

3 files changed

+77
-171
lines changed

modules/openapi/src/test/java/org/apache/axis2/openapi/McpAxis2PayloadTest.java

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@
5252
/**
5353
* Tests focused on the Axis2 JSON-RPC payload format documented in the MCP catalog.
5454
*
55-
* <h2>Background — the pyRapi challenge</h2>
55+
* <h2>Background</h2>
5656
*
57-
* <p>The Python {@code pyRapi} library (and its MCP successor {@code rapi-mcp}) demonstrate
58-
* that MCP clients calling Axis2 services must wrap their request body in the Axis2 JSON-RPC
57+
* <p>MCP clients calling Axis2 services must wrap their request body in the Axis2 JSON-RPC
5958
* envelope:
6059
* <pre>
6160
* {"operationName":[{"arg0":{&lt;params&gt;}}]}
@@ -68,19 +67,15 @@
6867
* <li>Each tool in the MCP catalog carries an {@code x-axis2-payloadTemplate} that is valid
6968
* JSON in the correct Axis2 envelope format.</li>
7069
* <li>The template is parseable and structurally correct (array of one {@code arg0} object).</li>
71-
* <li>The loginService template matches the known working pyRapi format.</li>
70+
* <li>The loginService template matches the documented login payload format.</li>
7271
* <li>Auth annotations ({@code x-requiresAuth}) correctly distinguish the public token
73-
* endpoint from protected services — mirrors the two-phase auth flow in pyRapi/auth.py
74-
* and rapi-mcp/server/rapi/api.py.</li>
72+
* endpoint from protected services — verifying the two-phase auth flow.</li>
7573
* <li>The catalog {@code _meta} block gives MCP clients all transport conventions without
7674
* requiring out-of-band documentation.</li>
7775
* </ul>
7876
*
79-
* <h2>Relationship to rapi-mcp (Python)</h2>
80-
* <p>The Python {@code rapi-mcp} server uses Bearer tokens and a flat REST payload — but that
81-
* server is a proxy that translates MCP tool calls into Axis2 JSON-RPC calls. These tests
82-
* verify that the Java Axis2 MCP catalog provides enough information for MCP clients to make
83-
* the same translation themselves without an intermediary proxy.
77+
* <p>These tests verify that the Axis2 MCP catalog provides enough information for MCP clients
78+
* to construct correct JSON-RPC payloads without an intermediary proxy.
8479
*/
8580
public class McpAxis2PayloadTest extends TestCase {
8681

@@ -193,7 +188,7 @@ public void testPayloadTemplateArg0IsEmptyObject() throws Exception {
193188
/**
194189
* loginService/doLogin is the authentication entry point.
195190
*
196-
* <p>In pyRapi the login call is:
191+
* <p>The expected login payload format is:
197192
* <pre>
198193
* {"doLogin":[{"arg0":{"email":"user@example.com","credentials":"pass"}}]}
199194
* </pre>
@@ -207,7 +202,7 @@ public void testLoginServicePayloadTemplateHasDoLoginKey() throws Exception {
207202
parsed.has("doLogin"));
208203
}
209204

210-
public void testLoginServicePayloadTemplateCompatibleWithPyRapiFormat() throws Exception {
205+
public void testLoginServicePayloadTemplateCompatibleWithExpectedFormat() throws Exception {
211206
addService("loginService", "doLogin");
212207
String template = getFirstTool("doLogin").path("x-axis2-payloadTemplate").asText();
213208
JsonNode parsed = MAPPER.readTree(template);
@@ -235,7 +230,7 @@ public void testLoginServiceNotRequiresAuth() throws Exception {
235230
* Phase 1: call loginService (no auth) → get token.
236231
* Phase 2: call protected service with Bearer token.
237232
*
238-
* <p>This mirrors the flow in pyRapi/auth.py and rapi-mcp/server/rapi/api.py.
233+
* <p>This verifies the standard Axis2 two-phase Bearer token authentication pattern.
239234
*/
240235
public void testTwoPhaseAuthFlowDocumentedInCatalog() throws Exception {
241236
// Register both the token endpoint and a protected service
@@ -299,7 +294,7 @@ public void testMetaAxis2FormatHintContainsArg0() throws Exception {
299294
/**
300295
* The {@code _meta.authHeader} must document the Bearer scheme so MCP
301296
* clients know how to attach the token obtained from loginService.
302-
* Mirrors the header set in rapi-mcp's RAPIClient._make_request().
297+
* MCP clients use this to attach the token obtained from loginService.
303298
*/
304299
public void testMetaAuthHeaderDocumentsBearerScheme() throws Exception {
305300
JsonNode meta = MAPPER.readTree(generator.generateMcpCatalogJson(mockRequest))

modules/openapi/src/test/java/org/apache/axis2/openapi/McpCatalogGeneratorTest.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ public void testGenerateMcpCatalogWithNullRequestDoesNotThrow() throws Exception
314314
/**
315315
* The catalog root must carry a {@code _meta} object so MCP clients know
316316
* the Axis2 JSON-RPC transport contract without reading separate docs.
317-
* Mirrors the pattern in rapi-mcp (Python) where API conventions are
318-
* embedded in the tool catalog for client self-sufficiency.
317+
* API conventions are embedded in the tool catalog so MCP clients are
318+
* self-sufficient without requiring separate documentation.
319319
*/
320320
public void testCatalogHasMetaObject() throws Exception {
321321
JsonNode root = MAPPER.readTree(generator.generateMcpCatalogJson(mockRequest));
@@ -361,8 +361,8 @@ public void testMetaHasTokenEndpoint() throws Exception {
361361
* know to wrap bare JSON params in the Axis2 JSON-RPC envelope:
362362
* {@code {"operationName":[{"arg0":{...}}]}}.
363363
*
364-
* <p>This is the primary challenge from pyRapi: MCP clients calling Axis2
365-
* services must use this wrapping format or the call fails silently.
364+
* <p>MCP clients calling Axis2 services must use this wrapping format or
365+
* the call fails silently.
366366
*/
367367
public void testToolHasPayloadTemplateField() throws Exception {
368368
addService("TestService", "testOp");
@@ -433,8 +433,7 @@ public void testPayloadTemplatesDistinctAcrossOperations() throws Exception {
433433

434434
/**
435435
* Non-login services must declare {@code x-requiresAuth: true} so MCP
436-
* clients know to acquire a Bearer token via loginService first — matching
437-
* the auth flow pyRapi implements in pyrapi/auth.py.
436+
* clients know to acquire a Bearer token via loginService first.
438437
*/
439438
public void testNonLoginServiceRequiresAuth() throws Exception {
440439
addService("testws", "doTestws");
@@ -476,7 +475,7 @@ public void testBigDataServiceRequiresAuth() throws Exception {
476475
/**
477476
* Tools must carry MCP 2025 {@code annotations} for client-side safety
478477
* hints (readOnlyHint, destructiveHint, idempotentHint, openWorldHint).
479-
* Matches the annotations pattern in internal-alpha-theory-mcp.
478+
* Follows the MCP 2025-03-26 specification for tool annotations.
480479
*/
481480
public void testToolHasAnnotationsField() throws Exception {
482481
addService("TestService", "testOp");
@@ -571,18 +570,18 @@ public void testTickerResolveEndpointAbsentWhenNotConfigured() throws Exception
571570
* This is the primary way to make tool descriptions useful to LLMs.
572571
*/
573572
public void testOperationLevelMcpDescriptionOverridesDefault() throws Exception {
574-
AxisService svc = new AxisService("GetAssetCalculationsService");
573+
AxisService svc = new AxisService("CalculationService");
575574
AxisOperation op = new InOutAxisOperation();
576-
op.setName(QName.valueOf("getAssetCalculations"));
575+
op.setName(QName.valueOf("getCalculations"));
577576
op.addParameter(new org.apache.axis2.description.Parameter(
578577
"mcpDescription",
579-
"Get calculated portfolio metrics (OPS, PWR, Kelly) for assets in a fund."));
578+
"Get calculated metrics for items in a dataset."));
580579
svc.addOperation(op);
581580
axisConfig.addService(svc);
582581

583582
JsonNode tool = getCatalogTools().get(0);
584583
assertEquals("Operation-level mcpDescription must be used as tool description",
585-
"Get calculated portfolio metrics (OPS, PWR, Kelly) for assets in a fund.",
584+
"Get calculated metrics for items in a dataset.",
586585
tool.path("description").asText());
587586
}
588587

@@ -642,14 +641,14 @@ public void testDescriptionFallsBackToAutoGeneratedWhenNoMcpDescriptionParam() t
642641
/**
643642
* When a service sets {@code mcpReadOnly=true}, the catalog must publish
644643
* {@code readOnlyHint: true} for all its operations. Read-only services
645-
* (GetAsset*, Search*) should set this so MCP hosts can safely auto-approve
646-
* them without human confirmation.
644+
* should set this so MCP hosts can safely auto-approve them without human
645+
* confirmation.
647646
*/
648647
public void testServiceLevelMcpReadOnlySetsTrueOnAnnotation() throws Exception {
649-
AxisService svc = new AxisService("GetAssetCalculationsService");
648+
AxisService svc = new AxisService("ReadOnlyDataService");
650649
svc.addParameter(new org.apache.axis2.description.Parameter("mcpReadOnly", "true"));
651650
AxisOperation op = new InOutAxisOperation();
652-
op.setName(QName.valueOf("getAssetCalculations"));
651+
op.setName(QName.valueOf("getData"));
653652
svc.addOperation(op);
654653
axisConfig.addService(svc);
655654

0 commit comments

Comments
 (0)