@andrebuzeli/git-mcp 11.0.1 → 11.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +9 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrebuzeli/git-mcp",
3
- "version": "11.0.1",
3
+ "version": "11.0.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "git-mcp": "bin/git-mcp.js"
package/src/server.js CHANGED
@@ -64,19 +64,24 @@ async function listSchemas() {
64
64
  export async function startServer() {
65
65
  process.stdin.setEncoding('utf-8')
66
66
  let buf = ''
67
+ process.stdin.resume()
67
68
  process.stdin.on('data', async chunk => {
68
69
  buf += chunk
69
- try {
70
- const req = JSON.parse(buf); buf = ''
70
+ const lines = buf.split(/\r?\n/)
71
+ buf = lines.pop() || ''
72
+ for (const line of lines) {
73
+ if (!line.trim()) continue
74
+ try {
75
+ const req = JSON.parse(line)
71
76
  if (req && req.jsonrpc === '2.0' && typeof req.method === 'string') {
72
77
  const id = req.id
73
78
  const m = req.method
74
79
  const p = req.params || {}
75
80
  try {
76
81
  if (m === 'initialize') {
77
- const result = { serverInfo: { name: '@andrebuzeli/git-mcp', version: '11.0.0' }, capabilities: { tools: true } }
82
+ const result = { serverInfo: { name: '@andrebuzeli/git-mcp', version: '11.0.2' }, capabilities: { tools: true } }
78
83
  writeJsonRpc(id, result)
79
- } else if (m === 'tools/list') {
84
+ } else if (m === 'tools/list' || m === 'listOfferings') {
80
85
  const schemas = await listSchemas()
81
86
  writeJsonRpc(id, { tools: schemas })
82
87
  } else if (m === 'tools/call' || m === 'callTool' || m === 'call') {
@@ -100,10 +105,6 @@ export async function startServer() {
100
105
  const res = await dispatch(req)
101
106
  process.stdout.write(JSON.stringify({ json: res }) + '\n')
102
107
  }
103
- } catch (e) {
104
- if (e instanceof SyntaxError) return
105
- process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error', data: e.message } }) + '\n')
106
- buf = ''
107
108
  }
108
109
  })
109
110
  }