eve-online-mcp 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -3
- package/dist/auth.d.ts +31 -9
- package/dist/auth.js +142 -28
- package/dist/auth.js.map +1 -1
- package/dist/character-authentication.d.ts +38 -0
- package/dist/character-authentication.js +35 -0
- package/dist/character-authentication.js.map +1 -0
- package/dist/character-context.js +1 -1
- package/dist/character-context.js.map +1 -1
- package/dist/cli.js +10 -6
- package/dist/cli.js.map +1 -1
- package/dist/credential-store.d.ts +48 -9
- package/dist/credential-store.js +160 -37
- package/dist/credential-store.js.map +1 -1
- package/dist/esi-client.d.ts +2 -2
- package/dist/esi-client.js +65 -16
- package/dist/esi-client.js.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/package-metadata.d.ts +1 -0
- package/dist/package-metadata.js +1 -0
- package/dist/package-metadata.js.map +1 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +80 -17
- package/dist/server.js.map +1 -1
- package/dist/sso.d.ts +5 -0
- package/dist/sso.js +20 -5
- package/dist/sso.js.map +1 -1
- package/dist/token-identity.d.ts +9 -0
- package/dist/token-identity.js +65 -0
- package/dist/token-identity.js.map +1 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ The server is generated at runtime from a pinned copy of CCP's OpenAPI 3.1 docum
|
|
|
6
6
|
|
|
7
7
|
## What the MCP server exposes
|
|
8
8
|
|
|
9
|
+
- `list_eve_characters` lists saved character IDs, names, and granted scopes without exposing credentials.
|
|
10
|
+
- `authorize_eve_character` opens browser consent for a specific character, verifies the selected identity, and stores that character's refresh credential. `select_eve_character` chooses a saved character for protected operations that do not name one. These tools manage local authentication only; they never change game state.
|
|
9
11
|
- `search_esi_operations` ranks endpoints using deterministic lexical and curated intent matching, supports hard tag/authentication filters and offsets, and explains every match.
|
|
10
12
|
- `get_esi_operation` returns exact parameters, request-body schema, required caller inputs, defaults, pagination guidance, OAuth scopes, cache hints, safe examples where available, and rate-limit metadata.
|
|
11
13
|
- `call_esi` invokes one page of one catalogued read operation. It rejects undeclared parameters, validates values, fixes the origin to ESI, supplies compatibility headers, and never accepts an Authorization header from a tool call.
|
|
@@ -54,16 +56,41 @@ Once published, configure your MCP host to run the npm package directly:
|
|
|
54
56
|
|
|
55
57
|
For a local checkout, build in the devcontainer and use `node /absolute/path/to/eve-online-mcp/dist/index.js` instead.
|
|
56
58
|
|
|
59
|
+
During MCP initialization, the server reports the version from its installed `package.json`, so MCP host diagnostics identify the running package release.
|
|
60
|
+
|
|
61
|
+
### Discovery in Codex and other MCP hosts
|
|
62
|
+
|
|
63
|
+
Installing the npm package makes the executable available; the MCP host must also be configured to launch it. For [Codex](https://learn.chatgpt.com/docs/extend/mcp?surface=cli), register the stdio server with:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
codex mcp add eve-online -- npx -y eve-online-mcp
|
|
67
|
+
codex mcp list
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The server advertises EVE Online use cases in every tool's title and description, and returns workflow guidance in the MCP initialization `instructions` field. This lets hosts recognize character sheets, skills, skill queues, markets and other ESI data requests before a prompt or catalog resource is opened. Codex reads these instructions; other hosts may handle them differently. Tool selection remains the host's decision.
|
|
71
|
+
|
|
72
|
+
For a named character's training or hauling plan, the intended path is `resolve_eve_entities`, then `get_character_context` with the resolved character-category ID and the `skills` and `skillQueue` sections. Other ESI questions use `search_esi_operations`, `get_esi_operation`, then `call_esi`. Public discovery needs no login; protected sections use EVE SSO. ESI does not expose Omega subscription status or saved in-game skill plans, and skill injector recommendations require current game rules and explicit assumptions in addition to character data.
|
|
73
|
+
|
|
74
|
+
To check discovery after updating the configured server, reconnect it or start a fresh host session and confirm that its tool list contains EVE Online tool titles. Try a request such as: "Use EVE Online data to review the character sheet, skills and skill queue for <exact character name>, and suggest a hauling training plan." The host should discover the EVE tools and resolve the name before retrieving the needed sections. Inspect the tool-call trace to verify that it uses MCP for ESI-covered data before inspecting the game client. This is a manual host check; the automated tests verify initialization metadata and tool listings, not model selection behavior.
|
|
75
|
+
|
|
76
|
+
If the host still overlooks the server, capture the exact prompt, host/model version, configured server command and arguments, initialization instructions, tool listing and relevant tool-call sequence. Exclude credentials, tokens and private character responses from a shared report. This distinguishes a connection or stale-metadata problem from a host tool-selection problem.
|
|
77
|
+
|
|
57
78
|
### EVE SSO
|
|
58
79
|
|
|
59
|
-
Public ESI routes need no credentials and never trigger login.
|
|
80
|
+
Public ESI routes need no credentials and never trigger login. Ask Codex for a character's protected data: when that character has no saved authorization, the server automatically opens EVE SSO in the browser. Select the requested character and approve access; the server verifies the identity, saves its separate refresh credential, and continues the request. Repeat for another character on the same or a different EVE account. Previously authorized characters remain available. No commands, client secret, or manual token handling are required.
|
|
81
|
+
|
|
82
|
+
Credentials are stored per character, not per EVE account. Both `call_esi` and `get_character_context` select the credential matching the requested `character_id`/`characterId`. A wrong-character browser selection saves nothing and reports the requested and selected IDs. Tokens with a different or unreadable character subject are rejected before making a protected character request. A remaining upstream 403 identifies the character and required scopes; ownership or corporation roles can still deny access even with the correct character.
|
|
83
|
+
|
|
84
|
+
Codex can inspect saved authorizations using `list_eve_characters` and renew consent using `authorize_eve_character` when scopes are missing or a grant has expired or been revoked. For corporation, fleet, or structure operations without a character path parameter, a sole saved character is used automatically. With multiple saved characters and no default, the server asks Codex to use `select_eve_character` for the intended character. This default never overrides a character-specific request. Login dialogs are serialized, and simultaneous requests for the same missing character share a successful login.
|
|
85
|
+
|
|
86
|
+
The versioned credential file lives in the user's OS configuration directory. Each entry stores a character ID/name, client ID, granted scopes, creation time, and refresh token. Access tokens stay in memory. Login and refresh validate EVE's signature, issuer, audiences, expiration, and character claims. Refresh-token rotation updates only the matching character; writes use a restricted-permission temporary file, atomic replacement, and locks to coordinate concurrent processes. Running servers reread the store to notice new consent or removal. Old single-credential files migrate on their next protected use after the character identity is verified; adding a new character before migration preserves the legacy credential.
|
|
60
87
|
|
|
61
88
|
The package ships with this public PKCE client configuration:
|
|
62
89
|
|
|
63
90
|
- Client ID: `6a65f1e650d240659dafbad29fb55e05`
|
|
64
91
|
- Callback URL: `http://localhost:52765/callback`
|
|
65
92
|
|
|
66
|
-
The callback must match the EVE application registration exactly. PKCE is intended for local applications that cannot keep a client secret, so never distribute or commit the client secret.
|
|
93
|
+
The callback must match the EVE application registration exactly. PKCE is intended for local applications that cannot keep a client secret, so never distribute or commit the client secret. Optional maintenance commands are available, but are not needed for the Codex workflow. `auth logout` removes all local character credentials:
|
|
67
94
|
|
|
68
95
|
```sh
|
|
69
96
|
npx eve-online-mcp auth login
|
|
@@ -136,7 +163,7 @@ esi-wallet.read_corporation_wallets.v1
|
|
|
136
163
|
|
|
137
164
|
</details>
|
|
138
165
|
|
|
139
|
-
`EVE_ACCESS_TOKEN`, `EVE_REFRESH_TOKEN`, `EVE_CLIENT_ID`, and `EVE_CLIENT_SECRET` remain supported as non-default overrides for automation or existing credentials.
|
|
166
|
+
`EVE_ACCESS_TOKEN`, `EVE_REFRESH_TOKEN`, `EVE_CLIENT_ID`, and `EVE_CLIENT_SECRET` remain supported as non-default overrides for automation or existing credentials. An environment token override represents one character and takes precedence over the local store; browser authorization tools are unavailable in that mode. Character requests still check the token subject and required scopes before spending an ESI request. Remove the token override to use automatic multi-character login.
|
|
140
167
|
|
|
141
168
|
Optional settings:
|
|
142
169
|
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { CredentialStore } from "./credential-store.js";
|
|
2
2
|
import { type SsoLoginOptions } from "./sso.js";
|
|
3
|
+
import { type TokenVerifier } from "./token-identity.js";
|
|
3
4
|
export declare const DEFAULT_EVE_CLIENT_ID = "6a65f1e650d240659dafbad29fb55e05";
|
|
4
5
|
export interface TokenProvider {
|
|
5
|
-
getAccessToken(requiredScopes?: string[]): Promise<string | undefined>;
|
|
6
|
+
getAccessToken(requiredScopes?: string[], characterId?: number): Promise<string | undefined>;
|
|
7
|
+
}
|
|
8
|
+
export declare class AuthenticationError extends Error {
|
|
9
|
+
readonly code: "CHARACTER_MISMATCH" | "CHARACTER_SELECTION_REQUIRED" | "MISSING_SCOPES";
|
|
10
|
+
readonly details: {
|
|
11
|
+
characterId?: number;
|
|
12
|
+
authenticatedCharacterId?: number;
|
|
13
|
+
missingScopes?: string[];
|
|
14
|
+
};
|
|
15
|
+
constructor(message: string, code: "CHARACTER_MISMATCH" | "CHARACTER_SELECTION_REQUIRED" | "MISSING_SCOPES", details?: {
|
|
16
|
+
characterId?: number;
|
|
17
|
+
authenticatedCharacterId?: number;
|
|
18
|
+
missingScopes?: string[];
|
|
19
|
+
});
|
|
6
20
|
}
|
|
7
21
|
export declare class StaticTokenProvider implements TokenProvider {
|
|
8
22
|
private readonly token;
|
|
@@ -14,27 +28,35 @@ export declare class RefreshTokenProvider implements TokenProvider {
|
|
|
14
28
|
private readonly clientSecret;
|
|
15
29
|
private readonly fetchImplementation;
|
|
16
30
|
private readonly onRefreshToken?;
|
|
31
|
+
private readonly verifyAccessToken?;
|
|
17
32
|
private cached?;
|
|
18
33
|
private currentRefreshToken;
|
|
19
|
-
|
|
34
|
+
private pending;
|
|
35
|
+
constructor(clientId: string, refreshToken: string, clientSecret: string | undefined, fetchImplementation?: typeof fetch, onRefreshToken?: ((refreshToken: string) => Promise<void> | void) | undefined, verifyAccessToken?: ((token: string) => Promise<void>) | undefined);
|
|
20
36
|
getAccessToken(): Promise<string>;
|
|
37
|
+
private refresh;
|
|
21
38
|
}
|
|
22
39
|
export declare class StoredCredentialTokenProvider implements TokenProvider {
|
|
23
40
|
private readonly store;
|
|
24
41
|
private readonly fetchImplementation;
|
|
25
|
-
private
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
private readonly verify;
|
|
43
|
+
private readonly providers;
|
|
44
|
+
constructor(store: CredentialStore, fetchImplementation?: typeof fetch, verify?: TokenVerifier);
|
|
45
|
+
getAccessToken(requiredScopes?: string[], characterId?: number): Promise<string | undefined>;
|
|
28
46
|
}
|
|
29
47
|
export declare class InteractiveSsoTokenProvider implements TokenProvider {
|
|
30
|
-
|
|
48
|
+
readonly store: CredentialStore;
|
|
31
49
|
private readonly clientId;
|
|
32
50
|
private readonly scopes;
|
|
33
51
|
private readonly loginImplementation;
|
|
52
|
+
private readonly redirectUri?;
|
|
34
53
|
private readonly storedProvider;
|
|
35
|
-
private
|
|
36
|
-
constructor(store: CredentialStore, clientId: string, scopes: string[], fetchImplementation?: typeof fetch, loginImplementation?: (options: SsoLoginOptions) => Promise<unknown
|
|
37
|
-
getAccessToken(): Promise<string>;
|
|
54
|
+
private loginTail;
|
|
55
|
+
constructor(store: CredentialStore, clientId: string, scopes: string[], fetchImplementation?: typeof fetch, loginImplementation?: (options: SsoLoginOptions) => Promise<unknown>, verify?: TokenVerifier, redirectUri?: string | undefined);
|
|
56
|
+
getAccessToken(requiredScopes?: string[], characterId?: number): Promise<string>;
|
|
57
|
+
authorizeCharacter(characterId: number): Promise<void>;
|
|
58
|
+
private login;
|
|
59
|
+
private enqueueLogin;
|
|
38
60
|
}
|
|
39
61
|
export declare function tokenProviderFromEnvironment(environment?: NodeJS.ProcessEnv, fetchImplementation?: typeof fetch, options?: {
|
|
40
62
|
clientId?: string;
|
package/dist/auth.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { CredentialStore, defaultCredentialPath, } from "./credential-store.js";
|
|
2
2
|
import { loginWithEveSso } from "./sso.js";
|
|
3
|
+
import { createTokenVerifier, } from "./token-identity.js";
|
|
3
4
|
export const DEFAULT_EVE_CLIENT_ID = "6a65f1e650d240659dafbad29fb55e05";
|
|
5
|
+
export class AuthenticationError extends Error {
|
|
6
|
+
code;
|
|
7
|
+
details;
|
|
8
|
+
constructor(message, code, details = {}) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.details = details;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
4
14
|
export class StaticTokenProvider {
|
|
5
15
|
token;
|
|
6
16
|
constructor(token) {
|
|
@@ -15,18 +25,27 @@ export class RefreshTokenProvider {
|
|
|
15
25
|
clientSecret;
|
|
16
26
|
fetchImplementation;
|
|
17
27
|
onRefreshToken;
|
|
28
|
+
verifyAccessToken;
|
|
18
29
|
cached;
|
|
19
30
|
currentRefreshToken;
|
|
20
|
-
|
|
31
|
+
pending;
|
|
32
|
+
constructor(clientId, refreshToken, clientSecret, fetchImplementation = fetch, onRefreshToken, verifyAccessToken) {
|
|
21
33
|
this.clientId = clientId;
|
|
22
34
|
this.clientSecret = clientSecret;
|
|
23
35
|
this.fetchImplementation = fetchImplementation;
|
|
24
36
|
this.onRefreshToken = onRefreshToken;
|
|
37
|
+
this.verifyAccessToken = verifyAccessToken;
|
|
25
38
|
this.currentRefreshToken = refreshToken;
|
|
26
39
|
}
|
|
27
40
|
async getAccessToken() {
|
|
28
41
|
if (this.cached && this.cached.expiresAt > Date.now() + 60_000)
|
|
29
42
|
return this.cached.token;
|
|
43
|
+
this.pending ??= this.refresh().finally(() => {
|
|
44
|
+
this.pending = undefined;
|
|
45
|
+
});
|
|
46
|
+
return this.pending;
|
|
47
|
+
}
|
|
48
|
+
async refresh() {
|
|
30
49
|
const body = new URLSearchParams({
|
|
31
50
|
grant_type: "refresh_token",
|
|
32
51
|
refresh_token: this.currentRefreshToken,
|
|
@@ -48,12 +67,18 @@ export class RefreshTokenProvider {
|
|
|
48
67
|
if (!response.ok)
|
|
49
68
|
throw new Error(`EVE SSO token refresh failed with HTTP ${response.status}`);
|
|
50
69
|
const value = (await response.json());
|
|
51
|
-
if (
|
|
70
|
+
if (typeof value.access_token !== "string" ||
|
|
71
|
+
!value.access_token ||
|
|
72
|
+
!Number.isFinite(value.expires_in) ||
|
|
73
|
+
value.expires_in <= 0 ||
|
|
74
|
+
(value.refresh_token !== undefined &&
|
|
75
|
+
(typeof value.refresh_token !== "string" || !value.refresh_token)))
|
|
52
76
|
throw new Error("EVE SSO returned an invalid token response");
|
|
77
|
+
await this.verifyAccessToken?.(value.access_token);
|
|
53
78
|
if (value.refresh_token &&
|
|
54
79
|
value.refresh_token !== this.currentRefreshToken) {
|
|
55
|
-
this.currentRefreshToken = value.refresh_token;
|
|
56
80
|
await this.onRefreshToken?.(value.refresh_token);
|
|
81
|
+
this.currentRefreshToken = value.refresh_token;
|
|
57
82
|
}
|
|
58
83
|
this.cached = {
|
|
59
84
|
token: value.access_token,
|
|
@@ -65,22 +90,83 @@ export class RefreshTokenProvider {
|
|
|
65
90
|
export class StoredCredentialTokenProvider {
|
|
66
91
|
store;
|
|
67
92
|
fetchImplementation;
|
|
68
|
-
|
|
69
|
-
|
|
93
|
+
verify;
|
|
94
|
+
providers = new Map();
|
|
95
|
+
constructor(store, fetchImplementation = fetch, verify = createTokenVerifier(fetchImplementation)) {
|
|
70
96
|
this.store = store;
|
|
71
97
|
this.fetchImplementation = fetchImplementation;
|
|
98
|
+
this.verify = verify;
|
|
72
99
|
}
|
|
73
|
-
async getAccessToken() {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this.
|
|
79
|
-
const
|
|
80
|
-
|
|
100
|
+
async getAccessToken(requiredScopes = [], characterId) {
|
|
101
|
+
let file = await this.store.read();
|
|
102
|
+
if (file.legacyCredential &&
|
|
103
|
+
(characterId === undefined ||
|
|
104
|
+
!file.characters.some((entry) => entry.characterId === characterId))) {
|
|
105
|
+
await this.store.withRefreshLock("legacy", async () => {
|
|
106
|
+
const legacy = (await this.store.read()).legacyCredential;
|
|
107
|
+
if (!legacy)
|
|
108
|
+
return;
|
|
109
|
+
let identity;
|
|
110
|
+
let refreshToken = legacy.refreshToken;
|
|
111
|
+
const provider = new RefreshTokenProvider(legacy.clientId, refreshToken, undefined, this.fetchImplementation, (replacement) => {
|
|
112
|
+
refreshToken = replacement;
|
|
113
|
+
}, async (token) => {
|
|
114
|
+
identity = await this.verify(token, legacy.clientId);
|
|
115
|
+
});
|
|
116
|
+
await provider.getAccessToken();
|
|
117
|
+
if (!identity)
|
|
118
|
+
throw new Error("EVE SSO did not return a verified character identity.");
|
|
119
|
+
await this.store.migrateLegacy(legacy, {
|
|
120
|
+
...legacy,
|
|
121
|
+
...identity,
|
|
122
|
+
refreshToken,
|
|
123
|
+
});
|
|
81
124
|
});
|
|
125
|
+
file = await this.store.read();
|
|
126
|
+
}
|
|
127
|
+
const characters = file.characters;
|
|
128
|
+
const selected = characterId ??
|
|
129
|
+
file.defaultCharacterId ??
|
|
130
|
+
(characters.length === 1 ? characters[0]?.characterId : undefined);
|
|
131
|
+
if (selected === undefined) {
|
|
132
|
+
if (characters.length > 1)
|
|
133
|
+
throw new AuthenticationError("Choose an authorized character for this protected operation using select_eve_character.", "CHARACTER_SELECTION_REQUIRED");
|
|
134
|
+
return undefined;
|
|
82
135
|
}
|
|
83
|
-
return this.
|
|
136
|
+
return this.store.withRefreshLock(selected, async () => {
|
|
137
|
+
const credential = (await this.store.read()).characters.find((entry) => entry.characterId === selected);
|
|
138
|
+
if (!credential) {
|
|
139
|
+
this.providers.delete(selected);
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
const missingScopes = requiredScopes.filter((scope) => !credential.scopes.includes(scope));
|
|
143
|
+
if (missingScopes.length)
|
|
144
|
+
throw new AuthenticationError(`Character ${selected} lacks required scopes; use authorize_eve_character to grant access.`, "MISSING_SCOPES", { characterId: selected, missingScopes });
|
|
145
|
+
let cached = this.providers.get(selected);
|
|
146
|
+
if (cached?.credential.refreshToken !== credential.refreshToken ||
|
|
147
|
+
cached.credential.clientId !== credential.clientId ||
|
|
148
|
+
cached.credential.createdAt !== credential.createdAt ||
|
|
149
|
+
JSON.stringify(cached.credential.scopes) !==
|
|
150
|
+
JSON.stringify(credential.scopes)) {
|
|
151
|
+
const entry = {
|
|
152
|
+
credential,
|
|
153
|
+
provider: new RefreshTokenProvider(credential.clientId, credential.refreshToken, undefined, this.fetchImplementation, async (refreshToken) => {
|
|
154
|
+
await this.store.rotate(entry.credential, refreshToken);
|
|
155
|
+
entry.credential = { ...entry.credential, refreshToken };
|
|
156
|
+
}, async (token) => {
|
|
157
|
+
const identity = await this.verify(token, credential.clientId);
|
|
158
|
+
if (identity.characterId !== selected)
|
|
159
|
+
throw new AuthenticationError(`The saved credential for character ${selected} authenticated character ${identity.characterId}; authorize the requested character again.`, "CHARACTER_MISMATCH", {
|
|
160
|
+
characterId: selected,
|
|
161
|
+
authenticatedCharacterId: identity.characterId,
|
|
162
|
+
});
|
|
163
|
+
}),
|
|
164
|
+
};
|
|
165
|
+
cached = entry;
|
|
166
|
+
this.providers.set(selected, cached);
|
|
167
|
+
}
|
|
168
|
+
return cached.provider.getAccessToken();
|
|
169
|
+
});
|
|
84
170
|
}
|
|
85
171
|
}
|
|
86
172
|
export class InteractiveSsoTokenProvider {
|
|
@@ -88,40 +174,68 @@ export class InteractiveSsoTokenProvider {
|
|
|
88
174
|
clientId;
|
|
89
175
|
scopes;
|
|
90
176
|
loginImplementation;
|
|
177
|
+
redirectUri;
|
|
91
178
|
storedProvider;
|
|
92
|
-
|
|
93
|
-
constructor(store, clientId, scopes, fetchImplementation = fetch, loginImplementation = loginWithEveSso) {
|
|
179
|
+
loginTail = Promise.resolve();
|
|
180
|
+
constructor(store, clientId, scopes, fetchImplementation = fetch, loginImplementation = loginWithEveSso, verify = createTokenVerifier(fetchImplementation), redirectUri) {
|
|
94
181
|
this.store = store;
|
|
95
182
|
this.clientId = clientId;
|
|
96
183
|
this.scopes = scopes;
|
|
97
184
|
this.loginImplementation = loginImplementation;
|
|
98
|
-
this.
|
|
185
|
+
this.redirectUri = redirectUri;
|
|
186
|
+
this.storedProvider = new StoredCredentialTokenProvider(store, fetchImplementation, verify);
|
|
99
187
|
}
|
|
100
|
-
async getAccessToken() {
|
|
101
|
-
const existing = await this.storedProvider.getAccessToken();
|
|
188
|
+
async getAccessToken(requiredScopes = [], characterId) {
|
|
189
|
+
const existing = await this.storedProvider.getAccessToken(requiredScopes, characterId);
|
|
102
190
|
if (existing)
|
|
103
191
|
return existing;
|
|
104
|
-
this.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
})
|
|
109
|
-
await this.
|
|
110
|
-
const token = await this.storedProvider.getAccessToken();
|
|
192
|
+
await this.enqueueLogin(async () => {
|
|
193
|
+
if (await this.storedProvider.getAccessToken(requiredScopes, characterId))
|
|
194
|
+
return;
|
|
195
|
+
await this.login(characterId);
|
|
196
|
+
});
|
|
197
|
+
const token = await this.storedProvider.getAccessToken(requiredScopes, characterId);
|
|
111
198
|
if (!token)
|
|
112
199
|
throw new Error("EVE SSO completed without storing a credential");
|
|
113
200
|
return token;
|
|
114
201
|
}
|
|
202
|
+
async authorizeCharacter(characterId) {
|
|
203
|
+
await this.enqueueLogin(async () => {
|
|
204
|
+
await this.login(characterId);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
async login(characterId) {
|
|
208
|
+
await this.loginImplementation({
|
|
209
|
+
clientId: this.clientId,
|
|
210
|
+
scopes: this.scopes,
|
|
211
|
+
store: this.store,
|
|
212
|
+
...(characterId === undefined
|
|
213
|
+
? {}
|
|
214
|
+
: { expectedCharacterId: characterId }),
|
|
215
|
+
...(this.redirectUri === undefined
|
|
216
|
+
? {}
|
|
217
|
+
: { redirectUri: this.redirectUri }),
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
async enqueueLogin(action) {
|
|
221
|
+
const pending = this.loginTail.then(action);
|
|
222
|
+
this.loginTail = pending.catch(() => undefined);
|
|
223
|
+
await pending;
|
|
224
|
+
}
|
|
115
225
|
}
|
|
116
226
|
export function tokenProviderFromEnvironment(environment = process.env, fetchImplementation = fetch, options = {}) {
|
|
117
227
|
if (environment.EVE_ACCESS_TOKEN)
|
|
118
228
|
return new StaticTokenProvider(environment.EVE_ACCESS_TOKEN);
|
|
119
229
|
if (environment.EVE_CLIENT_ID && environment.EVE_REFRESH_TOKEN) {
|
|
120
|
-
|
|
230
|
+
const clientId = environment.EVE_CLIENT_ID;
|
|
231
|
+
const verify = createTokenVerifier(fetchImplementation);
|
|
232
|
+
return new RefreshTokenProvider(environment.EVE_CLIENT_ID, environment.EVE_REFRESH_TOKEN, environment.EVE_CLIENT_SECRET, fetchImplementation, undefined, async (token) => {
|
|
233
|
+
await verify(token, clientId);
|
|
234
|
+
});
|
|
121
235
|
}
|
|
122
236
|
const store = new CredentialStore(defaultCredentialPath(environment));
|
|
123
237
|
if (options.interactive !== false && options.scopes?.length) {
|
|
124
|
-
return new InteractiveSsoTokenProvider(store, environment.EVE_CLIENT_ID ?? options.clientId ?? DEFAULT_EVE_CLIENT_ID, options.scopes, fetchImplementation);
|
|
238
|
+
return new InteractiveSsoTokenProvider(store, environment.EVE_CLIENT_ID ?? options.clientId ?? DEFAULT_EVE_CLIENT_ID, options.scopes, fetchImplementation, loginWithEveSso, createTokenVerifier(fetchImplementation), environment.EVE_SSO_REDIRECT_URI);
|
|
125
239
|
}
|
|
126
240
|
return new StoredCredentialTokenProvider(store, fetchImplementation);
|
|
127
241
|
}
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAwB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAwB,MAAM,UAAU,CAAC;AACjE,OAAO,EACL,mBAAmB,GAGpB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,kCAAkC,CAAC;AASxE,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAGjC;IAEA;IAJX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C;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { InteractiveSsoTokenProvider } from "./auth.js";
|
|
2
|
+
import type { CredentialStore } from "./credential-store.js";
|
|
3
|
+
/** Only non-secret character metadata crosses the MCP boundary. */
|
|
4
|
+
export declare class CharacterAuthentication {
|
|
5
|
+
private readonly store;
|
|
6
|
+
private readonly interactive?;
|
|
7
|
+
constructor(store: CredentialStore, interactive?: InteractiveSsoTokenProvider | undefined);
|
|
8
|
+
list(): Promise<{
|
|
9
|
+
characters: {
|
|
10
|
+
characterId: number;
|
|
11
|
+
characterName: string;
|
|
12
|
+
scopes: string[];
|
|
13
|
+
}[];
|
|
14
|
+
defaultCharacterId: number | null;
|
|
15
|
+
legacyCredentialPendingMigration: boolean;
|
|
16
|
+
browserAuthorizationAvailable: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
authorize(characterId: number): Promise<{
|
|
19
|
+
characters: {
|
|
20
|
+
characterId: number;
|
|
21
|
+
characterName: string;
|
|
22
|
+
scopes: string[];
|
|
23
|
+
}[];
|
|
24
|
+
defaultCharacterId: number | null;
|
|
25
|
+
legacyCredentialPendingMigration: boolean;
|
|
26
|
+
browserAuthorizationAvailable: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
select(characterId: number): Promise<{
|
|
29
|
+
characters: {
|
|
30
|
+
characterId: number;
|
|
31
|
+
characterName: string;
|
|
32
|
+
scopes: string[];
|
|
33
|
+
}[];
|
|
34
|
+
defaultCharacterId: number | null;
|
|
35
|
+
legacyCredentialPendingMigration: boolean;
|
|
36
|
+
browserAuthorizationAvailable: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Only non-secret character metadata crosses the MCP boundary. */
|
|
2
|
+
export class CharacterAuthentication {
|
|
3
|
+
store;
|
|
4
|
+
interactive;
|
|
5
|
+
constructor(store, interactive) {
|
|
6
|
+
this.store = store;
|
|
7
|
+
this.interactive = interactive;
|
|
8
|
+
}
|
|
9
|
+
async list() {
|
|
10
|
+
const file = await this.store.read();
|
|
11
|
+
return {
|
|
12
|
+
characters: file.characters.map(({ characterId, characterName, scopes }) => ({
|
|
13
|
+
characterId,
|
|
14
|
+
characterName,
|
|
15
|
+
scopes,
|
|
16
|
+
})),
|
|
17
|
+
defaultCharacterId: file.defaultCharacterId ?? null,
|
|
18
|
+
legacyCredentialPendingMigration: !!file.legacyCredential,
|
|
19
|
+
browserAuthorizationAvailable: !!this.interactive,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async authorize(characterId) {
|
|
23
|
+
if (!this.interactive)
|
|
24
|
+
throw new Error("Browser authorization is unavailable while environment token overrides are configured.");
|
|
25
|
+
await this.interactive.authorizeCharacter(characterId);
|
|
26
|
+
return this.list();
|
|
27
|
+
}
|
|
28
|
+
async select(characterId) {
|
|
29
|
+
if (!this.interactive)
|
|
30
|
+
throw new Error("Character selection is unavailable while environment token overrides are configured.");
|
|
31
|
+
await this.store.select(characterId);
|
|
32
|
+
return this.list();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=character-authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"character-authentication.js","sourceRoot":"","sources":["../src/character-authentication.ts"],"names":[],"mappings":"AAGA,mEAAmE;AACnE,MAAM,OAAO,uBAAuB;IAEf;IACA;IAFnB,YACmB,KAAsB,EACtB,WAAyC;QADzC,UAAK,GAAL,KAAK,CAAiB;QACtB,gBAAW,GAAX,WAAW,CAA8B;IACzD,CAAC;IAEJ,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACrC,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAC7B,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC3C,WAAW;gBACX,aAAa;gBACb,MAAM;aACP,CAAC,CACH;YACD,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,IAAI,IAAI;YACnD,gCAAgC,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB;YACzD,6BAA6B,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW;SAClD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,WAAmB;QACjC,IAAI,CAAC,IAAI,CAAC,WAAW;YACnB,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;QACJ,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB;QAC9B,IAAI,CAAC,IAAI,CAAC,WAAW;YACnB,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAC;QACJ,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -36,7 +36,7 @@ export async function getCharacterContext(client, catalog, input, options = {})
|
|
|
36
36
|
let authorizationError;
|
|
37
37
|
if (requiredScopes.length > 0) {
|
|
38
38
|
try {
|
|
39
|
-
authorization = await client.authorize(requiredScopes);
|
|
39
|
+
authorization = await client.authorize(requiredScopes, input.characterId);
|
|
40
40
|
}
|
|
41
41
|
catch (error) {
|
|
42
42
|
authorizationError = error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"character-context.js","sourceRoot":"","sources":["../src/character-context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,GAGf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACh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GAAG,EAAE,CAAC,CAAC;QACzB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,iBAAiB,EAAE,KAAK,CAAC,QAAQ;QACjC,MAAM,EACJ,SAAS,KAAK,QAAQ,CAAC,MAAM;YAC3B,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS,KAAK,CAAC;gBACf,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,SAAS;QACjB,QAAQ;QACR,MAAM,EAAE,KAAK;QACb,OAAO;KACR,CAAC,CAAC;IACH,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC;IAC3B,KAAK,MAAM,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACpD,IAAI,eAAe,CAAC,MAAM,CAAC,IAAI,cAAc;YAAE,MAAM;QACrD,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxC,IACE,OAAO,aAAa,KAAK,QAAQ;YACjC,aAAa,KAAK,IAAI;YACtB,QAAQ,IAAI,aAAa;YACzB,aAAa,CAAC,MAAM,KAAK,IAAI,EAC7B,CAAC;YACD,QAAQ,CAAC,OAAO,CAAC,GAAG;gBAClB,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,cAAc,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;aAC1D,CAAC;YACF,SAAS,IAAI,CAAC,CAAC;YACf,MAAM,GAAG,WAAW,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_EVE_CLIENT_ID } from "./auth.js";
|
|
2
|
-
import { CredentialStore } from "./credential-store.js";
|
|
2
|
+
import { CredentialStore, defaultCredentialPath } from "./credential-store.js";
|
|
3
3
|
import { loginWithEveSso } from "./sso.js";
|
|
4
4
|
function option(args, name) {
|
|
5
5
|
const index = args.indexOf(name);
|
|
@@ -16,7 +16,7 @@ function requestedScopes(args, catalog) {
|
|
|
16
16
|
export async function runAuthCommand(args, catalog, environment = process.env) {
|
|
17
17
|
if (args[0] !== "auth")
|
|
18
18
|
return false;
|
|
19
|
-
const store = new CredentialStore(environment
|
|
19
|
+
const store = new CredentialStore(defaultCredentialPath(environment));
|
|
20
20
|
const command = args[1];
|
|
21
21
|
if (command === "login") {
|
|
22
22
|
const clientId = option(args, "--client-id") ??
|
|
@@ -33,10 +33,14 @@ export async function runAuthCommand(args, catalog, environment = process.env) {
|
|
|
33
33
|
return true;
|
|
34
34
|
}
|
|
35
35
|
if (command === "status") {
|
|
36
|
-
const
|
|
37
|
-
console.log(
|
|
38
|
-
?
|
|
39
|
-
|
|
36
|
+
const file = await store.read();
|
|
37
|
+
console.log(file.characters.length
|
|
38
|
+
? file.characters
|
|
39
|
+
.map((entry) => `${entry.characterName} (${entry.characterId}): ${entry.scopes.length} scopes${file.defaultCharacterId === entry.characterId ? " (default)" : ""}`)
|
|
40
|
+
.join("\n")
|
|
41
|
+
: file.legacyCredential
|
|
42
|
+
? "A legacy EVE SSO credential will migrate on the next protected request."
|
|
43
|
+
: "EVE SSO is not configured. Public ESI operations remain available.");
|
|
40
44
|
return true;
|
|
41
45
|
}
|
|
42
46
|
if (command === "logout") {
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,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