@lynq/github 0.1.0 → 0.1.1
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 +66 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @lynq/github
|
|
2
|
+
|
|
3
|
+
GitHub OAuth provider for [lynq](https://www.npmjs.com/package/@lynq/lynq) MCP framework.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @lynq/github @lynq/lynq
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createMCPServer } from "@lynq/lynq";
|
|
15
|
+
import { github } from "@lynq/github";
|
|
16
|
+
|
|
17
|
+
const server = createMCPServer({ name: "my-server", version: "1.0.0" });
|
|
18
|
+
|
|
19
|
+
server.tool("private-data", github({
|
|
20
|
+
clientId: process.env.GITHUB_CLIENT_ID!,
|
|
21
|
+
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
|
|
22
|
+
redirectUri: "http://localhost:3000/lynq/auth/github/callback",
|
|
23
|
+
}), {
|
|
24
|
+
description: "Access private data",
|
|
25
|
+
}, async (args, c) => {
|
|
26
|
+
const user = c.session.get("user");
|
|
27
|
+
return c.text(`Hello, ${user.login}`);
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### With Hono adapter
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { mountLynq } from "@lynq/hono";
|
|
35
|
+
|
|
36
|
+
mountLynq(app, server, {
|
|
37
|
+
pages: {
|
|
38
|
+
github: {
|
|
39
|
+
clientId: process.env.GITHUB_CLIENT_ID!,
|
|
40
|
+
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Options
|
|
47
|
+
|
|
48
|
+
| Option | Type | Default | Description |
|
|
49
|
+
|---|---|---|---|
|
|
50
|
+
| `clientId` | `string` | required | GitHub OAuth App client ID |
|
|
51
|
+
| `clientSecret` | `string` | required | GitHub OAuth App client secret |
|
|
52
|
+
| `redirectUri` | `string` | required | OAuth callback URL |
|
|
53
|
+
| `scopes` | `string[]` | `[]` | GitHub OAuth scopes |
|
|
54
|
+
| `sessionKey` | `string` | `"user"` | Session key to store user data |
|
|
55
|
+
| `message` | `string` | `"Please sign in with GitHub to continue."` | Elicitation message |
|
|
56
|
+
| `timeout` | `number` | `300000` | Elicitation timeout (ms) |
|
|
57
|
+
| `skipIf` | `(c) => boolean` | — | Skip middleware conditionally |
|
|
58
|
+
| `onComplete` | `(c) => void` | — | Run after successful auth |
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
[https://hogekai.github.io/lynq/](https://hogekai.github.io/lynq/)
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynq/github",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "GitHub OAuth provider for lynq MCP framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lynq/lynq": "^0.8.
|
|
17
|
+
"@lynq/lynq": "^0.8.4"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"tsup": "^8.0.0",
|