Skip to content
Merged
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 AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Repository boundary

This repository owns only the `@agentcommunity/mcp` stdio connector. The hosted server and its tools live at `https://agentcommunity.org/mcp`; do not copy server logic here. The connector must remain anonymous, fixed-origin, telemetry-free, and dependency-pinned. It must never call a tool during tests or installation, expose an SDK API, accept an alternate remote URL, add install scripts, or store credentials. The sole local-publish exception is the reviewed `0.1.0` bootstrap required to create the npm package before trusted publishing can be attached; it must be deprecated after `0.1.1` is live. Every later publication, including canonical `0.1.1`, uses the tag-only OIDC workflow after `npm test` and `npm run package:audit` pass.
This repository owns only the `@agentcommunity/mcp` stdio connector. The hosted server and its tools live at `https://agentcommunity.org/mcp`; do not copy server logic here. The connector must remain anonymous, fixed-origin, telemetry-free, and dependency-pinned. It must never call a tool during tests or installation, expose an SDK API, accept an alternate remote URL, add install scripts, or store credentials. The sole local-publish exception is the reviewed `0.1.0` bootstrap required to create the npm package before trusted publishing can be attached; deprecate it only after canonical `0.1.2` is independently verified live. `v0.1.1` is a failed immutable historical tag with no npm publication and must never be moved, deleted, or reused. Forward release work targets canonical `0.1.2` through the tag-only OIDC workflow after `npm test` and `npm run package:audit` pass.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agentcommunity/mcp",
"version": "0.1.1",
"version": "0.1.2",
"description": "Official Agent Community MCP connector for stdio clients; bridges to the hosted Streamable HTTP server at https://agentcommunity.org/mcp",
"type": "module",
"exports": {},
Expand Down
31 changes: 27 additions & 4 deletions test/bin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@ import { promisify } from 'node:util';
import { fileURLToPath } from 'node:url';

import { applyChildExit, buildInvocation, helpText, installSignalForwarding } from '../bin.js';
import { normalizePackResult } from '../scripts/audit-package.mjs';

const execFileAsync = promisify(execFile);
const packageRoot = fileURLToPath(new URL('../', import.meta.url));

function packResultWithShape(value, shape) {
const candidate = Array.isArray(value) ? value[0] : Object.values(value)[0];
assert.ok(candidate);

if (shape === 'array') return [candidate];
assert.equal(shape, 'package-map');
return { '@agentcommunity/mcp': candidate };
}

function quoteForComSpec(argument) {
return `"${argument.replaceAll('"', '""')}"`;
}
Expand Down Expand Up @@ -101,7 +111,7 @@ test('builds the installed Windows shim invocation through ComSpec with robust q
);
});

async function withPackedInstall(callback) {
async function withPackedInstall(callback, packResultShape = 'array') {
const temporaryRoot = await mkdtemp(join(tmpdir(), 'agentcommunity-mcp-'));
const packDirectory = join(temporaryRoot, 'pack');
const clientDirectory = join(temporaryRoot, 'client');
Expand All @@ -121,7 +131,9 @@ async function withPackedInstall(callback) {
cwd: packageRoot,
...packInvocation.options,
});
const [{ filename }] = JSON.parse(packed.stdout);
const shapedPackResult = packResultWithShape(JSON.parse(packed.stdout), packResultShape);
const sourceManifest = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
const { filename } = normalizePackResult(shapedPackResult, sourceManifest.version);
const installInvocation = buildNpmInvocation([
'install',
'--ignore-scripts',
Expand Down Expand Up @@ -158,7 +170,7 @@ test('help describes a connector and never claims to own the server or SDK', fun
assert.doesNotMatch(helpText, /SDK|implements four tools|MCP server package/);
});

test('packed package emits help through the installed npm shim', async function () {
test('packed package emits help through the installed npm shim with array pack JSON', async function () {
await withPackedInstall(async function (clientDirectory) {
const shimName = process.platform === 'win32'
? 'agentcommunity-mcp.cmd'
Expand All @@ -173,7 +185,18 @@ test('packed package emits help through the installed npm shim', async function
assert.match(result.stdout, /Official Agent Community MCP connector/);
assert.match(result.stdout, /https:\/\/agentcommunity\.org\/mcp/);
assert.equal(result.stderr, '');
});
}, 'array');
});

test('packed installation accepts npm 12 package-keyed pack JSON', async function () {
await withPackedInstall(async function (clientDirectory) {
const installedManifest = JSON.parse(await readFile(
join(clientDirectory, 'node_modules', '@agentcommunity', 'mcp', 'package.json'),
'utf8',
));

assert.equal(installedManifest.name, '@agentcommunity/mcp');
}, 'package-map');
});

test('package metadata has no install scripts or SDK export', async function () {
Expand Down