We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsiiromiuy/notion-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
# π Fix npm 2FA Publishing Error
## β Error You're Seeing
```
npm error 403 403 Forbidden
Two-factor authentication or granular access token with bypass 2fa enabled
is required to publish packages.
```
---
## β
Quick Fix (Choose One)
### Solution 1: Publish with OTP (Fastest) β‘
```bash
cd /Users/itsyuimorii/Documents/githubnew/notion-mcp-server
# Open your 2FA app (Google Authenticator, Authy, etc.)
# Get the 6-digit code for npm
# Replace 123456 with your actual code
npm publish --access public --otp=123456
```
**β οΈ Important**:
- OTP codes expire every 30 seconds
- Copy and run the command immediately
- If it fails, get a new code and try again
---
### Solution 2: Create Automation Token (Recommended) π
This token bypasses 2FA for publishing.
#### Step 1: Create Token on npm Website
1. Visit: https://www.npmjs.com/settings/itsyuimorii/tokens
2. Click **"Generate New Token"**
3. Select **"Automation"** type
4. Copy the token (starts with `npm_`)
#### Step 2: Configure Token
```bash
# Save token to npm config
echo "//registry.npmjs.org/:_authToken=YOUR_TOKEN_HERE" > ~/.npmrc
# Replace YOUR_TOKEN_HERE with your actual token
```
#### Step 3: Publish
```bash
cd /Users/itsyuimorii/Documents/githubnew/notion-mcp-server
npm publish --access public
```
**β
Benefits**:
- No need to enter OTP every time
- Works in automated scripts
- More secure than disabling 2FA
---
### Solution 3: Use Updated publish.sh Script π
I've updated the script to handle 2FA automatically:
```bash
cd /Users/itsyuimorii/Documents/githubnew/notion-mcp-server
./publish.sh
```
The script will now:
1. Ask if you have 2FA enabled
2. Prompt for your OTP code
3. Include it in the publish command
---
## π§ͺ Testing After Fix
### Test 1: Verify Token (if using Solution 2)
```bash
# Should show your username
npm whoami
```
### Test 2: Test Publish (Dry Run)
```bash
npm publish --dry-run --access public
# Should show package contents without actually publishing
```
### Test 3: Actual Publish
```bash
# With OTP
npm publish --access public --otp=YOUR_CODE
# Or with Automation Token (no OTP needed)
npm publish --access public
```
---
## π Troubleshooting
### Issue: "Invalid OTP code"
**Causes**:
- Code expired (30 seconds)
- Wrong code copied
- Time sync issue on your device
**Fix**:
```bash
# Get fresh code from your 2FA app
# Ensure your device time is synced
npm publish --access public --otp=NEW_CODE
```
---
### Issue: "Token expired"
**Fix**:
```bash
# Re-login
npm logout
npm login
# Then try publishing again
npm publish --access public --otp=YOUR_CODE
```
---
### Issue: "Still getting 403 error"
**Possible causes**:
1. Wrong npm account logged in
2. Account doesn't have publish rights
3. Package name already taken
**Check**:
```bash
# 1. Verify logged in user
npm whoami
# Should show: itsyuimorii
# 2. Check if package name is available
npm view @itsyuimorii/notion-mcp-server
# Should show: 404 (if not published yet)
# 3. Verify account permissions
npm access ls-collaborators @itsyuimorii/notion-mcp-server
```
---
## π Comparison of Solutions
| Solution | Pros | Cons | Best For |
|----------|------|------|----------|
| **OTP** | β
Most secure<br>β
No setup needed | β Need code each time<br>β 30s expiry | One-time publishing |
| **Automation Token** | β
No OTP needed<br>β
Works in scripts<br>β
Still secure | β Initial setup<br>β Need to manage token | Regular publishing |
| **Disable 2FA** | β
No barriers | ββ Very insecure<br>β Not recommended | Never (unsafe) |
---
## π Recommended Workflow
### For First-Time Publishing (Right Now)
```bash
# Quick fix with OTP
cd /Users/itsyuimorii/Documents/githubnew/notion-mcp-server
# Open 2FA app, get code
npm publish --access public --otp=YOUR_CODE
```
### For Future Updates
```bash
# Set up Automation Token (one-time setup)
# 1. Create token at: https://www.npmjs.com/settings/itsyuimorii/tokens
# 2. Save to config:
echo "//registry.npmjs.org/:_authToken=YOUR_TOKEN" > ~/.npmrc
# 3. Publish anytime without OTP
npm publish --access public
```
---
## β
After Successful Publish
You should see:
```bash
+ @itsyuimorii/notion-mcp-server@1.0.0
```
Then verify:
```bash
# 1. Check npm page
open https://www.npmjs.com/package/@itsyuimorii/notion-mcp-server
# 2. Test install
npm install -g @itsyuimorii/notion-mcp-server
# 3. Verify version
npm list -g @itsyuimorii/notion-mcp-server
```
---
## π― Next Steps After Publishing
1. β
Create GitHub release
2. β
Update README with npm badges
3. β
Test installation
4. β
Share on social media
5. β
Submit to MCP Registry (optional)
See `NEXT_STEPS.md` for complete workflow.
---
## π‘ Pro Tips
### Tip 1: Save Your Automation Token Securely
```bash
# Store in password manager, not in git
# Add to .gitignore if using local .npmrc
echo ".npmrc" >> .gitignore
```
### Tip 2: Verify Before Publishing
```bash
# Always dry-run first
npm publish --dry-run --access public
```
### Tip 3: Use Environment Variables
```bash
# For CI/CD
export NPM_TOKEN=your_token
npm publish --access public
```
---
**Choose Solution 1 for immediate fix, Solution 2 for long-term use!** π