git-mob-mcp-server 1.0.5 → 1.0.6
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 +1 -2
- package/dist/gitMobServerFactory.js +3 -3
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/registerGitMobResource.js +2 -2
- package/dist/helpers/registerGitMobResourceAsTool.js +3 -3
- package/dist/helpers/registerGitMobResourceTemplate.js +4 -0
- package/dist/{resources → resourceTemplates}/gitMobHelp.js +2 -1
- package/dist/resourceTemplates/index.js +1 -0
- package/dist/resources/gitMobVersion.js +3 -3
- package/dist/resources/index.js +0 -1
- package/dist/resources/mobSessionCoauthorTrailers.js +3 -3
- package/dist/resources/mobSessionCoauthors.js +3 -5
- package/dist/resources/teamMembers.js +3 -5
- package/dist/types/GitMobResourceTemplate.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -33,8 +33,7 @@ Built using [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/
|
|
33
33
|
- `setup_git_mob_globally`: Sets up git-mob globally for the user.
|
34
34
|
- `setup_git_mob_locally`: Sets up git-mob locally for the current repository.
|
35
35
|
|
36
|
-
Because
|
37
|
-
- `get_git_mob_help`: Displays general help and usage information for the Git Mob CLI.
|
36
|
+
Because resources may not be fully supported in GitHub Copilot Agent mode yet, the some of them are also available as tools:
|
38
37
|
- `get_git_mob_version`: The installed version of the Git Mob CLI.
|
39
38
|
- `get_team_members`: List of all the team members that have been added to Git Mob.
|
40
39
|
- `get_mob_session_coauthors`: List of all coauthors currently included in the active mob or pairing session.
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
2
2
|
import * as tools from "./tools/index.js";
|
3
3
|
import * as resources from "./resources/index.js";
|
4
|
-
import
|
4
|
+
import * as resourceTemplates from "./resourceTemplates/index.js";
|
5
|
+
import { registerGitMobTool, registerGitMobResource, registerGtMobResourceAsTool, registerGitMobResourceTemplate, } from "./helpers/index.js";
|
5
6
|
export const createGitMobServer = () => {
|
6
7
|
const server = new McpServer({
|
7
8
|
name: "Git Mob",
|
@@ -12,15 +13,14 @@ export const createGitMobServer = () => {
|
|
12
13
|
resources: {},
|
13
14
|
},
|
14
15
|
});
|
16
|
+
registerGitMobResourceTemplate(server, resourceTemplates.gitMobHelp);
|
15
17
|
registerGitMobResource(server, resources.gitMobVersion);
|
16
|
-
registerGitMobResource(server, resources.gitMobHelp);
|
17
18
|
registerGitMobResource(server, resources.teamMembers);
|
18
19
|
registerGitMobResource(server, resources.mobSessionCoauthors);
|
19
20
|
registerGitMobResource(server, resources.mobSessionCoauthorTrailers);
|
20
21
|
// Currently, Github Copilot does not support dynamic resources in MCP Server,
|
21
22
|
// so we register them as tools as well
|
22
23
|
registerGtMobResourceAsTool(server, resources.gitMobVersion);
|
23
|
-
registerGtMobResourceAsTool(server, resources.gitMobHelp);
|
24
24
|
registerGtMobResourceAsTool(server, resources.teamMembers);
|
25
25
|
registerGtMobResourceAsTool(server, resources.mobSessionCoauthors);
|
26
26
|
registerGtMobResourceAsTool(server, resources.mobSessionCoauthorTrailers);
|
package/dist/helpers/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
export const registerGitMobResource = (server, resource) => {
|
2
|
-
const { name,
|
3
|
-
server.resource(name,
|
2
|
+
const { name, uri, metadata, readCallback } = resource;
|
3
|
+
server.resource(name, uri, metadata, readCallback);
|
4
4
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { URL } from "node:url";
|
2
2
|
export const registerGtMobResourceAsTool = (server, resource) => {
|
3
|
-
const { name,
|
3
|
+
const { name, uri, metadata, readCallback } = resource;
|
4
4
|
const toolName = `get_${name}`;
|
5
5
|
const annotations = {
|
6
6
|
title: toolName,
|
@@ -9,8 +9,8 @@ export const registerGtMobResourceAsTool = (server, resource) => {
|
|
9
9
|
idempotentHint: true,
|
10
10
|
openWorldHint: false,
|
11
11
|
};
|
12
|
-
const toolCallback = async (
|
13
|
-
const resourceResult = await readCallback(new URL(
|
12
|
+
const toolCallback = async (_args, extra) => {
|
13
|
+
const resourceResult = await readCallback(new URL(uri), extra);
|
14
14
|
const toolResult = {
|
15
15
|
content: resourceResult.contents
|
16
16
|
.filter((content) => typeof content.text === "string")
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
2
2
|
import { getHelp } from "../clients/gitMobClient.js";
|
3
|
+
import { UriTemplate } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
|
3
4
|
const name = "git_mob_help";
|
4
|
-
const template = new ResourceTemplate("gitmob://help{?command}", {
|
5
|
+
const template = new ResourceTemplate(new UriTemplate("gitmob://help{?command}"), {
|
5
6
|
list: undefined,
|
6
7
|
complete: {
|
7
8
|
command: () => ["setup", "coauthor", "help"],
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as gitMobHelp } from "./gitMobHelp.js";
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
2
2
|
import { getVersion } from "../clients/gitMobClient.js";
|
3
3
|
const name = "git_mob_version";
|
4
|
-
const
|
4
|
+
const uri = "gitmob://version";
|
5
5
|
const metadata = {
|
6
6
|
description: "The installed version of the Git Mob CLI.",
|
7
7
|
mimeType: "text/plain",
|
@@ -20,7 +20,7 @@ const readCallback = async (uri) => {
|
|
20
20
|
};
|
21
21
|
const resource = {
|
22
22
|
name,
|
23
|
-
|
23
|
+
uri,
|
24
24
|
metadata,
|
25
25
|
readCallback,
|
26
26
|
};
|
package/dist/resources/index.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
export { default as gitMobVersion } from "./gitMobVersion.js";
|
2
|
-
export { default as gitMobHelp } from "./gitMobHelp.js";
|
3
2
|
export { default as teamMembers } from "./teamMembers.js";
|
4
3
|
export { default as mobSessionCoauthors } from "./mobSessionCoauthors.js";
|
5
4
|
export { default as mobSessionCoauthorTrailers } from "./mobSessionCoauthorTrailers.js";
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
2
2
|
import { listMobSessionCoauthorTrailers } from "../clients/gitMobClient.js";
|
3
3
|
const name = "mob_session_coauthor_trailers";
|
4
|
-
const
|
4
|
+
const uri = "gitmob://mob-session-coauthor-trailers";
|
5
5
|
const metadata = {
|
6
6
|
description: "List of the git Co-authored-by trailers for the coauthors " +
|
7
7
|
"currently included in the active mob or pairing session. " +
|
@@ -32,7 +32,7 @@ const readCallback = async (uri) => {
|
|
32
32
|
};
|
33
33
|
const resource = {
|
34
34
|
name,
|
35
|
-
|
35
|
+
uri,
|
36
36
|
metadata,
|
37
37
|
readCallback,
|
38
38
|
};
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
2
2
|
import { listMobSessionCoauthors } from "../clients/gitMobClient.js";
|
3
3
|
const name = "mob_session_coauthors";
|
4
|
-
const
|
5
|
-
list: undefined,
|
6
|
-
});
|
4
|
+
const uri = "gitmob://mob-session-coauthors";
|
7
5
|
const metadata = {
|
8
6
|
description: "List of all coauthors currently included in the active mob or pairing session. " +
|
9
7
|
"If Git Mob is setup, these coauthors will be automatically added as " +
|
@@ -33,7 +31,7 @@ const readCallback = async (uri) => {
|
|
33
31
|
};
|
34
32
|
const resource = {
|
35
33
|
name,
|
36
|
-
|
34
|
+
uri,
|
37
35
|
metadata,
|
38
36
|
readCallback,
|
39
37
|
};
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import {} from "@modelcontextprotocol/sdk/server/mcp.js";
|
2
2
|
import { listCoauthors } from "../clients/gitMobClient.js";
|
3
3
|
const name = "team_members";
|
4
|
-
const
|
5
|
-
list: undefined,
|
6
|
-
});
|
4
|
+
const uri = "gitmob://team-members";
|
7
5
|
const metadata = {
|
8
6
|
description: "List of all the team members that have been added to Git Mob. " +
|
9
7
|
"The team members can then be used in pairing / mobbing sessions as coauthors." +
|
@@ -34,7 +32,7 @@ const readCallback = async (uri) => {
|
|
34
32
|
};
|
35
33
|
const resource = {
|
36
34
|
name,
|
37
|
-
|
35
|
+
uri,
|
38
36
|
metadata,
|
39
37
|
readCallback,
|
40
38
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|