@pipeworx/mcp-bible 0.1.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/LICENSE +21 -0
- package/README.md +36 -0
- package/package.json +10 -0
- package/src/index.ts +147 -0
- package/tsconfig.json +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @pipeworx/mcp-bible
|
|
2
|
+
|
|
3
|
+
MCP server for [bible-api.com](https://bible-api.com) — look up verses by reference, retrieve passages in multiple translations, and get random verses. Free, no auth required.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `get_verse` | Fetch a verse or verse range by reference (WEB translation) |
|
|
10
|
+
| `get_passage` | Fetch a passage with a specific translation (KJV, WEB, etc.) |
|
|
11
|
+
| `random_verse` | Fetch a random Bible verse |
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
Add to your MCP client config:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"bible": {
|
|
21
|
+
"type": "url",
|
|
22
|
+
"url": "https://gateway.pipeworx.io/bible"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## CLI Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx @anthropic-ai/mcp-client https://gateway.pipeworx.io/bible
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT
|
package/package.json
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bible MCP — wraps the Bible API (free, no auth)
|
|
3
|
+
* https://bible-api.com
|
|
4
|
+
*
|
|
5
|
+
* Tools:
|
|
6
|
+
* - get_verse: fetch a specific Bible verse or verse range by reference
|
|
7
|
+
* - get_passage: fetch a passage with a specific translation
|
|
8
|
+
* - random_verse: fetch a random Bible verse
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface McpToolDefinition {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object';
|
|
16
|
+
properties: Record<string, unknown>;
|
|
17
|
+
required?: string[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface McpToolExport {
|
|
22
|
+
tools: McpToolDefinition[];
|
|
23
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const BASE_URL = 'https://bible-api.com';
|
|
27
|
+
|
|
28
|
+
const tools: McpToolExport['tools'] = [
|
|
29
|
+
{
|
|
30
|
+
name: 'get_verse',
|
|
31
|
+
description:
|
|
32
|
+
'Fetch a specific Bible verse or verse range by reference (e.g. "john 3:16", "romans 8:28", "psalm 23:1-6"). Returns the verse text in the World English Bible (WEB) translation.',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
reference: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description:
|
|
39
|
+
'Bible reference string (e.g. "john 3:16", "genesis 1:1-3", "psalm 23"). Spaces will be encoded automatically.',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
required: ['reference'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'get_passage',
|
|
47
|
+
description:
|
|
48
|
+
'Fetch a Bible passage with a specified translation. Supported translations: web (World English Bible), kjv (King James Version), oeb-us, bbe, webbe, cherokee, dra.',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
reference: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Bible reference string (e.g. "john 3:16", "genesis 1:1-5")',
|
|
55
|
+
},
|
|
56
|
+
translation: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description:
|
|
59
|
+
'Translation code: "web" (default), "kjv", "oeb-us", "bbe", "webbe", "cherokee", "dra"',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
required: ['reference', 'translation'],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'random_verse',
|
|
67
|
+
description:
|
|
68
|
+
'Fetch a random Bible verse. Returns the reference, text, and translation.',
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {},
|
|
72
|
+
required: [],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
78
|
+
switch (name) {
|
|
79
|
+
case 'get_verse':
|
|
80
|
+
return getVerse(args.reference as string);
|
|
81
|
+
case 'get_passage':
|
|
82
|
+
return getPassage(args.reference as string, args.translation as string);
|
|
83
|
+
case 'random_verse':
|
|
84
|
+
return randomVerse();
|
|
85
|
+
default:
|
|
86
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface BibleApiResponse {
|
|
91
|
+
reference: string;
|
|
92
|
+
text: string;
|
|
93
|
+
translation_id: string;
|
|
94
|
+
translation_name: string;
|
|
95
|
+
verses: Array<{
|
|
96
|
+
book_id: string;
|
|
97
|
+
book_name: string;
|
|
98
|
+
chapter: number;
|
|
99
|
+
verse: number;
|
|
100
|
+
text: string;
|
|
101
|
+
}>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function formatResponse(data: BibleApiResponse) {
|
|
105
|
+
return {
|
|
106
|
+
reference: data.reference,
|
|
107
|
+
translation: data.translation_id,
|
|
108
|
+
translation_name: data.translation_name,
|
|
109
|
+
text: data.text.trim(),
|
|
110
|
+
verses: data.verses.map((v) => ({
|
|
111
|
+
book: v.book_name,
|
|
112
|
+
chapter: v.chapter,
|
|
113
|
+
verse: v.verse,
|
|
114
|
+
text: v.text.trim(),
|
|
115
|
+
})),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async function getVerse(reference: string) {
|
|
120
|
+
const encodedRef = encodeURIComponent(reference);
|
|
121
|
+
const res = await fetch(`${BASE_URL}/${encodedRef}`);
|
|
122
|
+
if (!res.ok) throw new Error(`Bible API error: ${res.status}`);
|
|
123
|
+
|
|
124
|
+
const data = (await res.json()) as BibleApiResponse;
|
|
125
|
+
return formatResponse(data);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function getPassage(reference: string, translation: string) {
|
|
129
|
+
const encodedRef = encodeURIComponent(reference);
|
|
130
|
+
const params = new URLSearchParams({ translation });
|
|
131
|
+
|
|
132
|
+
const res = await fetch(`${BASE_URL}/${encodedRef}?${params}`);
|
|
133
|
+
if (!res.ok) throw new Error(`Bible API error: ${res.status}`);
|
|
134
|
+
|
|
135
|
+
const data = (await res.json()) as BibleApiResponse;
|
|
136
|
+
return formatResponse(data);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function randomVerse() {
|
|
140
|
+
const res = await fetch(`${BASE_URL}/?random=verse`);
|
|
141
|
+
if (!res.ok) throw new Error(`Bible API error: ${res.status}`);
|
|
142
|
+
|
|
143
|
+
const data = (await res.json()) as BibleApiResponse;
|
|
144
|
+
return formatResponse(data);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default { tools, callTool } satisfies McpToolExport;
|