@dalcontak/blogger-mcp-server 1.0.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/start-dev.sh ADDED
@@ -0,0 +1,64 @@
1
+ #!/bin/bash
2
+
3
+ # Start the Blogger MCP server in development mode (HTTP for easy testing)
4
+
5
+ # Load .env file if it exists
6
+ if [ -f .env ]; then
7
+ echo "Loading environment from .env..."
8
+ set -a
9
+ source .env
10
+ set +a
11
+ fi
12
+
13
+ # Validate authentication: at least one method must be configured
14
+ HAS_OAUTH2=false
15
+ HAS_API_KEY=false
16
+
17
+ if [ -n "$GOOGLE_CLIENT_ID" ] && [ -n "$GOOGLE_CLIENT_SECRET" ] && [ -n "$GOOGLE_REFRESH_TOKEN" ]; then
18
+ HAS_OAUTH2=true
19
+ fi
20
+
21
+ if [ -n "$BLOGGER_API_KEY" ]; then
22
+ HAS_API_KEY=true
23
+ fi
24
+
25
+ if [ "$HAS_OAUTH2" = false ] && [ "$HAS_API_KEY" = false ]; then
26
+ echo "ERROR: No authentication configured."
27
+ echo ""
28
+ echo "Set at least one of:"
29
+ echo " BLOGGER_API_KEY (read-only access to public blogs)"
30
+ echo " GOOGLE_CLIENT_ID + GOOGLE_CLIENT_SECRET + GOOGLE_REFRESH_TOKEN (full access)"
31
+ echo ""
32
+ echo "You can set them in a .env file or export them before running this script."
33
+ exit 1
34
+ fi
35
+
36
+ if [ "$HAS_OAUTH2" = true ]; then
37
+ echo "Auth: OAuth2 (full access)"
38
+ else
39
+ echo "Auth: API Key (read-only)"
40
+ fi
41
+
42
+ # Install dependencies if needed
43
+ if [ ! -d "node_modules" ]; then
44
+ echo "Installing dependencies..."
45
+ npm install
46
+ fi
47
+
48
+ # Default to HTTP mode for easy manual testing with curl
49
+ export MCP_MODE="${MCP_MODE:-http}"
50
+
51
+ echo ""
52
+ echo "Starting Blogger MCP server in development mode..."
53
+ echo "Mode: $MCP_MODE"
54
+ if [ "$MCP_MODE" = "http" ]; then
55
+ echo "Endpoint: http://localhost:${MCP_HTTP_PORT:-3000}"
56
+ echo ""
57
+ echo "Example:"
58
+ echo " curl -X POST http://localhost:${MCP_HTTP_PORT:-3000} \\"
59
+ echo " -H 'Content-Type: application/json' \\"
60
+ echo " -d '{\"tool\": \"get_blog\", \"params\": {\"blogId\": \"2399953\"}}'"
61
+ fi
62
+ echo ""
63
+
64
+ npm run dev
package/start-prod.sh ADDED
@@ -0,0 +1,53 @@
1
+ #!/bin/bash
2
+
3
+ # Start the Blogger MCP server in production mode
4
+
5
+ # Load .env file if it exists
6
+ if [ -f .env ]; then
7
+ echo "Loading environment from .env..."
8
+ set -a
9
+ source .env
10
+ set +a
11
+ fi
12
+
13
+ # Validate authentication: at least one method must be configured
14
+ HAS_OAUTH2=false
15
+ HAS_API_KEY=false
16
+
17
+ if [ -n "$GOOGLE_CLIENT_ID" ] && [ -n "$GOOGLE_CLIENT_SECRET" ] && [ -n "$GOOGLE_REFRESH_TOKEN" ]; then
18
+ HAS_OAUTH2=true
19
+ fi
20
+
21
+ if [ -n "$BLOGGER_API_KEY" ]; then
22
+ HAS_API_KEY=true
23
+ fi
24
+
25
+ if [ "$HAS_OAUTH2" = false ] && [ "$HAS_API_KEY" = false ]; then
26
+ echo "ERROR: No authentication configured."
27
+ echo ""
28
+ echo "Set at least one of:"
29
+ echo " BLOGGER_API_KEY (read-only access to public blogs)"
30
+ echo " GOOGLE_CLIENT_ID + GOOGLE_CLIENT_SECRET + GOOGLE_REFRESH_TOKEN (full access)"
31
+ echo ""
32
+ echo "You can set them in a .env file or export them before running this script."
33
+ exit 1
34
+ fi
35
+
36
+ if [ "$HAS_OAUTH2" = true ]; then
37
+ echo "Auth: OAuth2 (full access)"
38
+ else
39
+ echo "Auth: API Key (read-only)"
40
+ fi
41
+
42
+ # Verify the project is compiled
43
+ if [ ! -d "dist" ] || [ ! -f "dist/index.js" ]; then
44
+ echo "ERROR: Project is not compiled. Run 'npm run build' first."
45
+ exit 1
46
+ fi
47
+
48
+ echo ""
49
+ echo "Starting Blogger MCP server in production mode..."
50
+ echo "Mode: ${MCP_MODE:-stdio}"
51
+ echo ""
52
+
53
+ node dist/index.js
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "declaration": true,
6
+ "outDir": "./dist",
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true
12
+ },
13
+ "include": ["src/**/*"],
14
+ "exclude": ["node_modules", "dist", "**/*.test.ts"]
15
+ }
package/vercel.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": 2,
3
+ "builds": [
4
+ {
5
+ "src": "dist/index.js",
6
+ "use": "@vercel/node"
7
+ }
8
+ ],
9
+ "routes": [
10
+ {
11
+ "src": "/(.*)",
12
+ "dest": "dist/index.js"
13
+ }
14
+ ],
15
+ "env": {
16
+ "BLOGGER_API_KEY": "@blogger_api_key",
17
+ "MCP_MODE": "http",
18
+ "MCP_HTTP_HOST": "0.0.0.0",
19
+ "MCP_HTTP_PORT": "3000",
20
+ "BLOGGER_MAX_RESULTS": "10",
21
+ "BLOGGER_API_TIMEOUT": "30000",
22
+ "LOG_LEVEL": "info"
23
+ }
24
+ }