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
24 changes: 0 additions & 24 deletions .changeset/agent-mcp-subpath.md

This file was deleted.

36 changes: 0 additions & 36 deletions .changeset/agent-tool-set.md

This file was deleted.

63 changes: 63 additions & 0 deletions packages/agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
# @openrouter/agent

## 0.10.0

### Minor Changes

- [#102](https://github.com/OpenRouterTeam/typescript-agent/pull/102) [`787cbf8`](https://github.com/OpenRouterTeam/typescript-agent/commit/787cbf8b22bf2b8071e81e2dbf84ecd871a5e824) Thanks [@LukasParke](https://github.com/LukasParke)! - Add the full MCP integration under the canonical `@openrouter/agent/mcp` subpath. `@modelcontextprotocol/client` is an optional peer, so base agent installations and imports do not install or load MCP support. The existing `@openrouter/mcp` package remains as a compatibility facade and now re-exports the canonical agent subpaths.

```ts
import { callModel, OpenRouter } from "@openrouter/agent";
import { createMCPTools } from "@openrouter/agent/mcp";

const mcp = await createMCPTools({ url: "https://mcp.example.com/mcp" });
const result = callModel(new OpenRouter(), {
model: "openai/gpt-4o-mini",
input: "Use the remote tools.",
tools: mcp.tools,
});
```

Install `@modelcontextprotocol/client` alongside `@openrouter/agent` when using `/mcp`. The SDK is loaded lazily, so importing the base agent or the MCP entry point does not require the peer; the first MCP connection attempt without it throws an actionable `MCPMissingPeerDependencyError`.

Existing `@openrouter/mcp` imports continue to work as tooling-visible deprecated migration facades, but new code should prefer `@openrouter/agent/mcp`. The facade would only be removed in a future breaking release after migration notice.

The `@openrouter/mcp` facade continues to install `@modelcontextprotocol/client` transitively for backward compatibility; only direct `@openrouter/agent/mcp` users need to add the optional peer explicitly.

- [#31](https://github.com/OpenRouterTeam/typescript-agent/pull/31) [`8d2ed61`](https://github.com/OpenRouterTeam/typescript-agent/commit/8d2ed61964aa063936763c7b80f6b5bf389fa144) Thanks [@mattapperson](https://github.com/mattapperson)! - Add `@openrouter/agent/tool-set` (port of ai-tool-set v1.0.0, MIT © Chris Cook): declarative activate / deactivate / activateWhen / deactivateWhen for tools with state- and context-aware predicates. Integrates with a new `activeTools?: readonly string[]` option on `callModel` that filters which tools are sent to the model for a given call.

```ts
import { callModel, OpenRouter, serverTool, tool } from "@openrouter/agent";
import { createToolSet } from "@openrouter/agent/tool-set";
import { z } from "zod/v4";

type AppContext = { accountId: string };

// Curried form preserves the literal name for correlated tool event types.
const listOrders = tool<AppContext>()({
name: "list_orders",
inputSchema: z.object({}),
execute: async (_params, ctx) => ({
accountId: ctx?.shared.accountId,
orders: [],
}),
});
// override the default `server:${type}` id
const search = serverTool(
{ type: "web_search_2025_08_26" },
{ id: "public_search" }
);

const toolSet = createToolSet({
tools: [listOrders, search] as const,
}).deactivate("list_orders");

const client = new OpenRouter({ apiKey: process.env["OPENROUTER_API_KEY"] });
const resolved = toolSet.resolve();

// resolved.callModel is `{ tools, activeTools }` — spread it straight in
const result = callModel(client, {
model: "openai/gpt-4o-mini",
input: "Search for OpenRouter pricing.",
...resolved.callModel,
});
```

## 0.9.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/agent/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@openrouter/agent",
"version": "0.9.0",
"version": "0.10.0",
"author": "OpenRouter",
"description": "Agent toolkit for building AI applications with OpenRouter \u2014 tool orchestration, streaming, multi-turn conversations, and format compatibility.",
"description": "Agent toolkit for building AI applications with OpenRouter tool orchestration, streaming, multi-turn conversations, and format compatibility.",
"keywords": [
"openrouter",
"agent",
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/mcp/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Run `pnpm --filter @openrouter/agent gen:version` after bumping the version.

/** This package's version, self-reported to MCP servers as `clientInfo`. */
export const PACKAGE_VERSION = '0.9.0';
export const PACKAGE_VERSION = '0.10.0';
29 changes: 29 additions & 0 deletions packages/mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# @openrouter/mcp

## 1.1.0

### Minor Changes

- [#102](https://github.com/OpenRouterTeam/typescript-agent/pull/102) [`787cbf8`](https://github.com/OpenRouterTeam/typescript-agent/commit/787cbf8b22bf2b8071e81e2dbf84ecd871a5e824) Thanks [@LukasParke](https://github.com/LukasParke)! - Add the full MCP integration under the canonical `@openrouter/agent/mcp` subpath. `@modelcontextprotocol/client` is an optional peer, so base agent installations and imports do not install or load MCP support. The existing `@openrouter/mcp` package remains as a compatibility facade and now re-exports the canonical agent subpaths.

```ts
import { callModel, OpenRouter } from "@openrouter/agent";
import { createMCPTools } from "@openrouter/agent/mcp";

const mcp = await createMCPTools({ url: "https://mcp.example.com/mcp" });
const result = callModel(new OpenRouter(), {
model: "openai/gpt-4o-mini",
input: "Use the remote tools.",
tools: mcp.tools,
});
```

Install `@modelcontextprotocol/client` alongside `@openrouter/agent` when using `/mcp`. The SDK is loaded lazily, so importing the base agent or the MCP entry point does not require the peer; the first MCP connection attempt without it throws an actionable `MCPMissingPeerDependencyError`.

Existing `@openrouter/mcp` imports continue to work as tooling-visible deprecated migration facades, but new code should prefer `@openrouter/agent/mcp`. The facade would only be removed in a future breaking release after migration notice.

The `@openrouter/mcp` facade continues to install `@modelcontextprotocol/client` transitively for backward compatibility; only direct `@openrouter/agent/mcp` users need to add the optional peer explicitly.

### Patch Changes

- Updated dependencies [[`787cbf8`](https://github.com/OpenRouterTeam/typescript-agent/commit/787cbf8b22bf2b8071e81e2dbf84ecd871a5e824), [`8d2ed61`](https://github.com/OpenRouterTeam/typescript-agent/commit/8d2ed61964aa063936763c7b80f6b5bf389fa144)]:
- @openrouter/agent@0.10.0

## 1.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/mcp",
"version": "1.0.0",
"version": "1.1.0",
"engines": {
"node": ">=20"
},
Expand Down
Loading