Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds i18n support #115

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions docs/specification/basic/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ The client **MUST** initiate this phase by sending an `initialize` request conta
"listChanged": true
},
"sampling": {}
"locale": {
"preferredLanguages": ["en-US", "en-GB", "fr-FR"]
}
},
"clientInfo": {
"name": "ExampleClient",
Expand Down Expand Up @@ -92,6 +95,9 @@ The server **MUST** respond with its own capabilities and information:
},
"tools": {
"listChanged": true
},
"locale": {
"language": "en-US"
}
},
"serverInfo": {
Expand Down Expand Up @@ -132,11 +138,13 @@ Key capabilities include:
|----------|--------------- |-------------|
| Client | `roots` | Ability to provide filesystem [roots]({{< ref "/specification/client/roots" >}}) |
| Client | `sampling` | Support for LLM [sampling]({{< ref "/specification/client/sampling" >}}) requests |
| Client | `locale` | Provides [i18n support]({{< ref "/specification/client/i18n" >}}) |
| Client | `experimental` | Describes support for non-standard experimental features |
| Server | `prompts` | Offers [prompt templates]({{< ref "/specification/server/prompts" >}}) |
| Server | `resources` | Provides readable [resources]({{< ref "/specification/server/resources" >}}) |
| Server | `tools` | Exposes callable [tools]({{< ref "/specification/server/tools" >}}) |
| Server | `logging` | Emits structured [log messages]({{< ref "/specification/server/utilities/logging" >}}) |
| Server | `locale` | | Provides [i18n support]({{< ref "/specification/server/i18n" >}}) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Server | `locale` | | Provides [i18n support]({{< ref "/specification/server/i18n" >}}) |
| Server | `locale` | Provides [i18n support]({{< ref "/specification/server/i18n" >}}) |

| Server | `experimental` | Describes support for non-standard experimental features |

Capability objects can describe sub-capabilities like:
Expand Down
1 change: 1 addition & 0 deletions docs/specification/client/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ Clients can implement additional features to enrich connected MCP servers:
{{< cards >}}
{{< card link="roots" title="Roots" icon="folder" >}}
{{< card link="sampling" title="Sampling" icon="annotation" >}}
{{< card link="i18n" title="I18n support" icon="globe-alt" >}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we use 'i18n' in other parts. Let's be consistent with upper/lowercase.

Suggested change
{{< card link="i18n" title="I18n support" icon="globe-alt" >}}
{{< card link="i18n" title="i18n support" icon="globe-alt" >}}

{{< /cards >}}
11 changes: 11 additions & 0 deletions docs/specification/client/i18n.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we will start a new subdirectory for the draft of the next protocol version. We will have to move all files over. We should still mark these docs as PROPOSED

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: I18n support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

type: docs
weight: 40
---

{{< callout type="info" >}}
**Protocol Revision**: {{< param protocolRevision >}}
{{< /callout >}}

Coming soon.
1 change: 1 addition & 0 deletions docs/specification/server/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ Explore these key primitives in more detail below:
{{< card link="prompts" title="Prompts" icon="chat-alt-2" >}}
{{< card link="resources" title="Resources" icon="document" >}}
{{< card link="tools" title="Tools" icon="adjustments" >}}
{{< card link="i18n" title="I18n support" icon="globe-alt" >}}
{{< /cards >}}
11 changes: 11 additions & 0 deletions docs/specification/server/i18n.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: I18n support
type: docs
weight: 40
---

{{< callout type="info" >}}
**Protocol Revision**: {{< param protocolRevision >}}
{{< /callout >}}

Coming soon.
33 changes: 33 additions & 0 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,22 @@
"description": "Experimental, non-standard capabilities that the client supports.",
"type": "object"
},
"locale": {
"description": "Present if the client has a list of preferred languages for translatable fields.",
"properties": {
"preferredLanguages": {
"description": "An array of preferred languages for translatable fields, listed in descending order of priority.",
"items": {
"$ref": "#/definitions/LanguageTag"
},
"type": "array"
}
},
"required": [
"preferredLanguages"
],
"type": "object"
},
"roots": {
"description": "Present if the client supports listing roots.",
"properties": {
Expand Down Expand Up @@ -822,6 +838,10 @@
],
"type": "object"
},
"LanguageTag": {
"description": "A string representing a BCP 47 language tag.",
"type": "string"
},
"ListPromptsRequest": {
"description": "Sent from the client to request a list of prompts and prompt templates the server has.",
"properties": {
Expand Down Expand Up @@ -1743,6 +1763,19 @@
"description": "Experimental, non-standard capabilities that the server supports.",
"type": "object"
},
"locale": {
"description": "Present if the server specifies the language it uses for translatable fields.",
"properties": {
"language": {
"$ref": "#/definitions/LanguageTag",
"description": "The language used by the server for translatable fields."
}
},
"required": [
"language"
],
"type": "object"
},
"logging": {
"additionalProperties": true,
"description": "Present if the server supports sending log messages to the client.",
Expand Down
23 changes: 23 additions & 0 deletions schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ export interface InitializedNotification extends Notification {
method: "notifications/initialized";
}

/**
* A string representing a BCP 47 language tag.
*/
export type LanguageTag = string;

/**
* Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
*/
Expand All @@ -203,6 +208,15 @@ export interface ClientCapabilities {
* Present if the client supports sampling from an LLM.
*/
sampling?: object;
/**
* Present if the client has a list of preferred languages for translatable fields.
*/
locale?: {
/**
* An array of preferred languages for translatable fields, listed in descending order of priority.
*/
preferredLanguages: LanguageTag[];
};
}

/**
Expand Down Expand Up @@ -248,6 +262,15 @@ export interface ServerCapabilities {
*/
listChanged?: boolean;
};
/**
* Present if the server specifies the language it uses for translatable fields.
*/
locale?: {
/**
* The language used by the server for translatable fields.
*/
language: LanguageTag;
};
}

/**
Expand Down